In my apps, i want to use CGRectFromString to set UIButton position. my code just like that
NSString *g = @"{0,0},{100, 100}";
CGRect rect = CGRectFromString(g);
self.button1.frame = rect;
but is dosent work. anything i miss or it's apple bug ??
You can set frame using this , its working fine. follow this link to drop your eye on CGRect
CGRect optionsFrame = {{0, 0}, {100, 100}};
self.button1.frame = optionsFrame;
or if you really want to use CGRectFromString then please make soma changes
NSString *g = @"{{0,0},{100, 100}}";
I hope you understand..:)
Try like this....
NSString *g = @"{{0,0},{100, 100}}";
CGRect rect = CGRectFromString(g);
self.button1.frame = rect;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With