objective-c

Sending a message to an object

I'm pretty new to Objective C but things are progressing well. However, I think I'm missing a key concept relating to how objects are created and messaged. I hope someone can help me. I'm creating an iPhone app that simply creates a MPMusicPlayer, and starts playing a song from the que. I create the music player (myPlayer) in the AppDe...

How to dynamically create a sqlite3 database on the iPhone?

Hello, I would like to know if it is possible to create the file of a database by programming? Actually I need to create a database if it does not exist. ...

Push to another view with UIBarButtonSystemItemAdd

Hi, I am trying to edit the add button to push to another view. But I am receiving an error -(void)locationAdd:(id)sender{ if([self.parentViewController isKindOfClass:[UINavigationController class]]){ UINavigationController *parent = (UINavigationController *)self.parentViewController; if ([[parent viewControllers] objectAtIndex:0...

What does the asterisk before variable signify?

Does anyone know where I can find documentation about what the asterisk before variables is used for. I don't understand it and it's starting to become a problem because I have noticed you don't need it for all types for e.g. BOOL doesn't return it. ...

First Time Opened Event

Hi In my iPad app, I have a UIAlertView which pops up upon start up, however I only want this to popup the very first time the user starts the application. Its a setup prompt, saying, its your first time, would you like to setup? How can I do this? I have heard its best to write out to a plist file and save a bool value, but how would ...

how to scroll a uimage view inside another uiimageview

Hi to all, i have created a music application where i dynamically image view and created buttons and dynamically added scrollview to it.now to this main veiw i have added a view and an image view and a button and i want that my dynamically add imageview and buttons should scroll from behind the view that i have added now to the view.Ple...

How to parse a date from a string containing a time zone

I need to parse following string into NSDate. Example: 2008-09-28T02:48:16+05:30 I tried following but it is not working NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"]; NSLog(@"Date=%@",[dateFormatter dateFromString:@"2008-09-28T02:48:16+05:30"]);...

How to set a zoom level as 15 in the MapKit using iPhone sdk

Hi all, I am implementing a MapKit based application. In that I need to set the zoom level as 15. Based on this I need to change the region. I tried with the following code but it is not working as expected. When I used the returned region and set to the Mapview it is getting exception like "NSInvalidArgumentException', reason: 'Invalid...

How to declare AsyncSocket instance as Global.

I am using AsyncSocket class for a chat application. But i want to use the AsyncSocket instance creating in the Login page for the entire project. That means i want to reuse the instance of AsyncSocket which created in the Login page for the chatViewControl Class. Can anyone help me to find a solution for this? ...

UITableView and NXXMLParser ... Calling Heirarchy

Hi Guys, I am stuck in a strange situation , i am getting data from the website using XML files and i am filling an Array (NSMutableArray Type) that i later use to display the data on Table View. The problem is that functions related to UITableView are called earlier and at that time the Array is not filled, this cause the program to cr...

corner like in maps App

Hi, I need a corner like in the Maps app. I tried this code but nothing happens: - (IBAction) performCurl { // Curl the image up or down CATransition *animation = [CATransition animation]; [animation setDelegate:self]; [animation setDuration:1.0f]; [animation setTimingFunction:UIViewAnimationCurveEaseInOut]; [animation setType:(not...

Call presentModalViewController from NSObject class

In my subclass of NSObject I would like to call something like [[self navController] presentModalViewController:myView animated:YES]; But none of my tries were successful. How can I call a modal view if I'm not in a subclass of UIViewController? Solution: #import "myProjectNameAppDelegate.h" // ... MyViewController *myView = [[M...

Imitating fullscreen gesture of MPMoviePlayerController on UIImageView

When the user makes a zoom gesture, I need the image to animate to fullscreen, without bouncing around or having to gesture more than once. Movies played using MPMoviePlayerController have exactly this behaviour. I note some people have implemented something similar using scrollview/webview, but that doesn't give the same effect, and of...

For loops in Objective-C

counter = [myArray count]; for (i = 0 ; i < count ; i++) { [[anotherArray objectAtIndex:i] setTitle:[myArray objectAtIndex:i]]; } I would like to do it the objective C 2.0 way but can't seem to find how to access the index 'i' (if that's possible anyway). for (NSString *myString in myArray) { [[anotherArray objectAtIndex:i]...

Uiimage won't be shown upon uiscrollview

Hello, i've created a tabbar application. Within the app i have a tab item containing a uinavigation controller.My problem is to display a uiimage upon a uiscrollview i pushed. Instead only the UIScrollview will be shown. My nib file of the pushed view looks like this: +UIView +UIScrollview -UILabel +UIImage(with shadow)...

Decrease time in objective-c

Hi all, I have a number of hours and a number of minutes, and I want a reduce the time of 1 second. So, I think I must create a nsdate object with my time, and after find the method to decrease the time. I looked in the apple documentation but I don't find how to do this. thanks Alex ...

Symbolic breakpoints in XCode suddenly not working.

Update: if you've added symbolic breakpoints and they're not working, uh, "wait awhile". After posting this and moving on and doing something else in the project, I then had an objc_exception_throw caught at some point. I've been adding -[NSException raise] and objc_exception_throw as symbolic breakpoints to all my projects and it's wor...

Is using the UIKEYBOARD class legal?

Hello all, I just added a done button on my number keyboard and read that using the keyboard class directly is illegal but some people said that their app was successfully submitted to the app store? Does anyone know if it is legal or not?I have been googling around for 1hr and I keep getting yes and nos.. anyone knows for certain if thi...

How to keep an iPhone app running on background fully operational.

Hi, first of all, I know there is only support for voip, audio and location apps to run in background and that they will run just while the audio is been played or while using location services, etc. What I want to know is if there is a way to keep my app running on background fully operational, doesn't matter the impact on battery's li...

Is this memory safe?

[NSTimer scheduledTimerWithTimeInterval:0.033 target:self selector:@selector(gameLoop) userInfo:nil repeats:YES]; I don't do anything to dealloc or kill this timer after starting it. Is it safe? Or will it cause me to leak memory? ...