A UILabel's text is drawn in a CGRect(x,y,size,width). The label can have multiple lines of text.
Is it possible to write a function to return a CGPoint within this rectangle that designates the position of the last character?
I ask because I am trying to wrap the text of a UILabel in an arbitrary prefix and suffix. The prefix/suffix n...
Hi, I am new to programming for the iPhone. I want to allow my users to participate in a competition, to a maximum of n times a day. Is there anyway of going about that programmatically and/or through a server for optimal security (i have done NSUserDefaults). ?
Is it possible to get the database server to check the number of entries ma...
I put an NSLog statement inside my applicationDidFinishLaunching method. I build and run and see the log output. Then if I hit the home button (in the simulator) and restart the app, I don't see the log output.
Why?
...
Hi all,
I am in memory-leak cleanup mode on my latest app, and have come across something that I am unable to solve.
the following method has been cleaned up except for 1 nagging issue. Instruments tells me that my NSMutableArray called itemsToKeep is leaking memory, at the point that I am creating the object. Any ideas on why I am leak...
When I get a 3rd party static library, I can use it in my debug or release builds for both the simulator and device. However, when I build locally, it is targeted for debug simulator/device or the same for release. I then have to coordinate my host app to match the library build. How can I create a single static library build that wor...
I'm currently setting up this view to be swapped with another in an iPhone game. When I use this code...
- (void)viewDidLoad {
menuViewController = [[menuViewController alloc] initWithNibName:@"SomeViewController" bundle:nil];
self.menuViewController = menuViewController;
[self.view insertSubview:menuViewController.view a...
Alright, I'll try to explain this the best I can. I have an iPhone app and it has a text field which the user can only input Numbers. Not a problem there. However, there is no done button on the numpad, so I can't make it disappear. I could make a button that the user presses to dismiss the keyboard, but I'd rather have a done button...
I add 10 buttons to UIScrollView
for (int i=0; i<10; i++) {
UIButton *btn = ....
[ScrollView addSubview:btn];
}
How can i refer to each button ?
...
I've been spending way too long trying to figure out what is going wrong, so I hope someone her can help me out.
My Code:
- (IBAction)fedDog {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documen...
I have such a code:
[self performSelectorInBackground:@selector(indicator) withObject:nil];
[self mail]; //opening my controller of e-mail sending
- (void)indicator
{
[actView startAnimating];
}
This works fine, but i'm afraid of thread safety. I'm not allocating memory in a second thread, but smth tell's me that's too simple:)
...
Hi All,
I just want to search my IPhone's address book by a received call's phone number. How can I proceed further in this case? Suppose my received call is in the format of (ISD code) xxxxxxxxxx, like (+1 1234567890) or (001 1234567890) or (+11234567890) or (+1 (123) 456-7890) or (1234567890 without ISD code) or something else. So how...
Hi... I've just added a settings bundle to my app and am having trouble reading the bool settings. I know that upon launch of the app, the settings are not read unless the user actually enters them - and that's what I am trying to capture.
However, my code is simply capturing if the answer is NO OR they havent been set. I need to find ...
Hey guys,
I wanted to test the mapKit and wanted to make my own overlay to display the accuracy of my position.
If i have a zoom factor of for example .005 which radius does my circle around me has to have(If my accuracy is for example 500m)?
Would be great to get some help :)
Thanks a lot.
...
Hi
I need to fire this function
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{}
when the UITextField of a Custom Cell in a UITableView is selected, so far it only fires when the row gets selected.
Thanks.
...
A user logs into a Facebook session in my iPhone app, and then I call a PHP page on my server that needs to use that session to access the user's Facebook account. Is it possible to start the session in the PHP page and be authenticated automatically? Perhaps by passing in the session key and secret from the iPhone app?
...
Hi,
I got a problem that it hasn't change to portrait mode when using the following code:
NSString *url = @"http://abc.com/movie.3gp";
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:url]];
moviePlayer.scalingMode = MPMovieScalingModeAspectFill; // seen nothing change w...
Wake on LAN so cool, just want to write a iPhone app to WOL my PC, but have no idea to code, any one can point me the way?
...
I have a UIWebView in my app that shows some html-formatted text (loaded from a .plist file from my bundle). The UIWebView takes about 1 second to render the text on the screen and during that second the whole UIWebView is white. I have tried setting the backgronud color of the view to clear or black but that did not do anything. I also ...
Is it possible for an iPhone app to stay dormant while making some kind of regitration request with the iPhone OS so that it will get "wake up call" at a certain time and become the active app?
...
Hello everyone,
I have got experience in iPhone programming but not really in graphics programming.
I decided to make a 2d game and choose Quartz 2D for this purpose (I'm familiar with Open GL, but quartz seems to be easier for a 2d game).
Is there a built-in way to draw a graph of a math formula in Quartz? For beginning it will be on...