iphone

Synchronizing Core Data data with External Database

I have started working on an iPhone application that where I need to synchronize data with an external MySQL database. The current database scheme uses GUID/UUID fields as primary keys to maintain relationships between tables. I already have this working between a database app and the MySQL database, so this isn't a question regarding sy...

Basic iPhone table question

Hi, In IB, I dragged a UITableViewController object from the library into the project. Then, a tableview popped up. How do I get that tableview inside my already existing window? Thanks, I'm totally lost! Roger ...

Question about retain count on objects in objects added to arrays, Obj-C

Hi everyone, I'm developing an iPhone app and have a question about memory management. Let's say I have a class called Company with a NSNumber property(nonatomic,retain) called Id. I do this: Company *company = [[Company alloc] initWithId:[NSNumber numberWithInt:1]]; Id should now have a retain count of 1? Then I do: NSMutableArray *...

NSDate from NSString

I've read the DateFormatting guide and I'm still not able to get a working formatter. NSString *string = @"0901Z 12/17/09"; //This is a sample date. The Z stands for GMT timezone //The 0901 is 09h 01m on a 24 hour clock not 12. //As long as I can get the hours/min & date from the string I can deal with the time zone later NSDateForma...

Rotating only the MapView's content

Hello. I am trying to rotate a map view in my app according the the user's current route. (I don't like to use the built in compasse because only 3GS uses it and it suffers too much interference from other machines, i.e. your own car.). the CGAffineTransformMakeRotation method will rotate the Whole Map View, so the Google Logo will not ...

iPhone Web App to Native app using Airplay SDK?

Has anyone had any experience of this? Is it easy? I know very little C, but all I want to do is package the web app as a native app. Is that allowed by Apple anyway? Thanks! ...

Leaks reporting issue with NSURLConnection sendSynchronousRequest

Any idea why sendSynchronousRequest is causing a leak below? Instruments states that the responsible frame is NSURLConnection and it points at a NSCFString leaked in the line with sendSynchronousRequest. I've read that this was a known issue before OS 2.2 or something, but should definitely be fixed now. Any thoughts? [UIApplication ...

iPhone cellForRowAtIndexPath returns cached cell

Hi, When i add a label to a cell using: - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; [cell addSubView:someLabel]; } It adds the label to multple cells, because it adds the label to a cached cel...

Accessing properties of programmatically created UIButton from within a method

I have created several UI elements in the viewDidLoad method. I want to change the color of a particular UIButton from within one of my methods. How can I do this? I've tried something similar to: self.view.myUIButton.backgroundColor = myUIColor That doesn't work. What am I missing? ...

Problem working with NSMutableArray to store objects other than just strings in UITableViewController

I am a novice using iPhone SDK and Objective C. I am facing a stupid issue with the NSMutableArray object. I have a Team class and a Player class. Team class has an NSMutableArray object that holds the Player objects. Team class is initialized with initWithTitle:(NSString*)title constructor. Player has Name property. Now, I have a simp...

Does disk caching with NSURLRequest and NSURLConnection actually work on the iPhone?

I have a UITableView whose cells contain custom ImageViews that asynchronously load the images from the internet. To load those images I use NSURLRequest and NSURLConnection which works fine. The only problem is that the images are not cached and therefore are downloaded every time they are used. I tried to set the cachePolicy of the NSU...

Question on Utility Application - iPhone SDK

Hello everybody, I have this application I made on a utility based app. How would I incorporate this app into a view based application so I can run the code from there.. Like 2 seperate projects in one. I basically want to open/show the utility app in my view based application when I press a button.. Is this possible?? ...

Using NSNumberFormatter to pad spaces between a currency symbol and the value

Hi Apologies if this is a dumb question but I'm trying to format a currency value for my iphone app and am struggling to left-justify the currency symbol, but right-justify the value. So, "$123.45" is formatted as (say) $ 123.45 depending on format-width. This is a kind of accounting format (I think). I've tried various methods with...

Crash when converting string to date

In my app I DO NOT want to use the local time on the phone. I want to get the current time in GMT. To do this I have a date formatter with time zone set to GMT. I then do the following to get back the current time: NSString *dateOne = [df stringFromDate:[NSDate date]]; NSDate *date1 = [df dateFromString:dateOne]; My app gets an EXC_BA...

Changing number of button rows in UIAlertView using public API's

In a UIAlertView I need to align buttons into rows so that there are either 2 in each row or 3 in each row. This is for an appstore app so I need to use documented methods. So obviously I can't use setNumberOfRows: for this. Suggestions on how I could achieve the same effect? ...

CellForRowAtIndexPath Causing issues, when can I release a local inside there?

Hey all, I have a UITableView that displays various nsstrings from a custom object called a "Transaction." in CellForRowAtIndexPath it the allocates a new instance of a transaction and then copies the the values from a particular transaction that lives in the delegate array so I can access it from different views. It then uses the new ...

Using Core Animation with objects other than CALayers

I was pretty sure I had seen discussions of this around the Net, but now I can't seem to find anything. The question is simple: is there a way to use for example CABasicAnimation to animate a property on an object that's not a ´CALayer´? (Say, the ´volume´ property on an ´AVAudioPlayer´.) If not, is there a way to make it work other tha...

Core Data / NSArray Causing Leaks?

I am having a specific leak that I can't seem to dig to the bottom of, cause my search always ends up in some Apple libraries. Any help from some veterans at dealing with this would be appreciated. Here is the relevant source code: (leak indicated with a comment) - (void)viewDidLoad { //[super viewDidLoad]; NSManagedObjectContext *con...

How to reduce memory footprint when instantiating a hierarchy of model objects in Cocoa?

I'm writing a quiz application for iPhone using basic NSObject subclasses to represent the models. At runtime the various controllers instantiate the model classes and populate them with data read in from a plist on the disk. The model classes represent the basic hierarchy of a multiple choice quiz: One application has many quizzes O...

Is it possible to restart your app programatically

Hello, I'm looking for a way to reboot my app after an in app purchase has been made. Once the user upgrades I need the ads to go away and to basically reload the app from scratch so all the new functionality will be added the next time the app loads. I'm thinking the easiest way is going to be to exit the app then automatically restar...