objective-c

where are autorelease pools required in a secondary NSThread runloop?

The run loop for the secondary thread of my application is below. It has a nested control loops. The outer loop runs for the duration of the application The inner loop runs while one view is open, then the thread waits while the view is not open. Passes through the inner loop are short, a fraction of a second. My code does not knowin...

CoreLocation Accuracy Woes

I have a program with a location manager set up like this: self.locationManager = [[CLLocationManager alloc] init]; [locationManager startUpdatingLocation]; locationManager.delegate = self; locationManager.distanceFilter = kCLDistanceFilterNone; locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters; I need the accurac...

xcode objective-c warnings

Hi, I'm relatively new to objective-c...I'm using the iphone 3.0 SDK I have a UIView, which is a subview, that I want to resize under certain circumstances. The way I do it is within a controller class. for example, CGSize el = CGSizeMake(30, 40); [self.subview setSize:el]; the above code does work, but the compiler gives a warning...

when is it safe to release an NSThread?

Below is the runloop for my secondary NSThread* processThread To close the thread I call //cancel secondary thread [processThread cancel] //signal condition [processCondition broadcast]; Is it then safe to then call: [processCondition release]; [processThread release]; or do i need to be sure that the thread has finished? Perhap...

How to add linebreaks in iPhone programming ?

Hi, everyone... I need to know how to add a linebreak in plain text such as UILabel. Soli...there is an amendment at here.... The linebreaks will added on the plain text on SMS or any notification alert message. So, the "escape sequence" can used as well ? Thanks ...

how to add linebreak in iPhone notification alert message or plain text on SMS

hi.... what is the code for the line break in the iPhone notification alert message or plain text on SMS ? Thanks ...

Objective-C error: Property 'active' is a scalar type on class 'Routine'. Cannot generate a getter method for it.

I'm getting the above error when the following runs in the iphone simulator (3.0 OS): @interface Routine : NSManagedObject { } @property (nonatomic) BOOL active; @implementation Routine @dynamic active @end As you can see, I'm subclassing NSManagedObject because I'm using Core Data. In my data model, "active" is an option attribute...

animationDidStop set but not being called (iPhone app coding)

#import "MyViewController.h" @implementation MyViewController @synthesize menuView, gameView, helpView, optionsView, gameButton, helpButton, optionsButton; - (void) viewDidLoad { [self setView:menuView]; } - (IBAction)gotoGame { [UIView beginAnimations:@"buttonSlide" context: nil]; [UIView setAnimationDuration:1.5]; [UIView setAnimat...

Receive touch events from an UIView from a Nib

I'm sure this is an easy one, yet I need some pointing in the right direction. I have a rather complicated NIB that I would like to have only one view in that nib to listen for touch & multi-touch events. What is the best way of doing so using IBOutlets? Thanks ...

Parsing This String in Objective C: 60.56MB / 237.03MB 1526kbps 25.5%, 00:15:47 remaining

I am writing a front-end for a command line utility in Objective-C (Cocoa). I need to parse the output to check for different types of messages. There are two basic types; information messages and download status messages. Information messages always begin with one of the following: INFO:, WARNING:, ERROR:, or : . The download status mes...

iPhone Core Data fetching date manipulations

Hi, I'm new to developing for the iPhone and I'm using Core Data for my data management. My managed objects have a property called creationDate and I need to have a list of all distinct dates that are in the database. To reduce the overhead I set [fetchRequest setPropertiesToFetch:[NSArray arrayWithObject:@"creationDate"]]; because th...

how to find that flip animation has finished iphone?

how do i find that flip animation has finished animation? i want to update a label's text just after animation has finished.. or how do i update a view during flip animation.? ...

Is there an overview of all codes that can be used inside NSLog()?

i.e. %@ for strings, %f for doubles... I don't know the word for these placeholders but it would be great to have list for how to print booleans and other values. ...

Accessing Objective-C / Cocoa Touch Arrays

Hi there, I'm using Cocoa Touch to build an iPhone app. I have an NSMutableArray called stories, that on printing to the console displays something like this: 2009-07-20 12:38:30.541 testapp[4797:20b] ( { link = "http://www.testing.com"; message = "testing"; username = "test"; }, { link = "http://www.testing2.c...

error when using object: "lvalue required as left operand of assignment"

Hi - I'm getting a strange error when assigning a value to one of my objects. As best as I can figure out, the compiler thinks I'm assigning to a read only variable. It gives me "lvalue required as left operand of assignment" on the myPlace.publicLocation... line. I'm sure it's a classic novice mistake - where am I going wrong? CSP...

Can't stop movie playback immediately

When you launch a video and IMMEDIATELY press "Done" the MPMoviePlayerController will exit, however the video still plays in the background (you can hear the audio). It works fine if you allow the video to begin playing before you hit the "Done" button. Does anybody know a workaround for this? ...

How to make iPhone screen dim

I have a refresh button on my iphone screen that refreshes a table in the current view. The screen refresh beautifully, but is there a way I can make the screen dim and then lighten again after the table has refreshed? ...

Can I release a no longer needed property of an instance of an object without worrying that dealloc will later "over-release" it?

I have an instance of an object "myObject" that has a few UIImage objects as properties. After I access these properties the first time I really don't need them any more. Can I do a release on the instance's UIImage properties before the instance itself is released, or will this over-release the UIImage properties later when the "myObj...

UISearchBar Above Navigation Bar

Hi, All the applications I have ever seen, that use UINavigationBars, have the UINavigationBar right at the top of the app. If you want to use a UISearchBar then it's usually in the 'header' of the UITableView such as this... What I would like to do is to put a UISearchBar object above/outside of the UINavigationBar/Controller, but i...

possible to change topbar UITABLEview

Hello all what I would like to know is it even possible to change the Color of the top bar in this UITableView ( the nav + toolbar )(code wise). http://sites.google.com/site/iphonesdktutorials/images/navtoolbar/App.jpg Another question concerning the top bar , how do they manage to remove the backbutton like here item 1 is the one I ...