objective-c

Objective C memory management

The following code is on apple's website. 1) Inside the setMyArray method, is it necessary to release myArray before setting a new value to it? I thought setting the value of an object to a new object, will release the old object from memory. 2) why does it say myArray = [newArray mutableCopy];, instead of simply saying myArray = newAr...

viewDidLoad is called only the first time

hello. someone could tell me please why when launch my app in the second time (after pressing the home button) the method viewDidLoad is not being called. thanx. ...

Bold & Non-Bold Text In A Single UILabel?

How would it be possible to include both bold and non-bold text in a uiLabel? I'd rather not use a UIWebView.. I've also read this may be possible using NSAttributedString but I have no idea how to use that. Any ideas? Apple achieves this in several of their apps; Examples Screenshot: link text Thanks! - Dom ...

Cocoa thread synchronisation when using [ALAssetsLibrary enumerateGroupsWithTypes:]

I have recently, like a few people, discovered that [ALAssetsLibrary enumerateGroupsWithTypes] likes to run its blocks on another thread. What a shame that Apple didn't document that :-) In my current circumstance I need to wait for the enumeration to complete, before the main thread returns any results. I clearly need some sort of thre...

Group objects with iPhone SDK?

Hi In my iPhone app, I have a number of UIImageView that do the same thing, then a second load which do the same thing. Can I some how tag/group these so that I can simply reference all the objects with one name? Otherwise it means having to have dozens of lines of code for a single repetitive action. Thanks! ...

Is there a library or example for creating Excel (.xlsx) files?

I'm writing a Cocoa application and I'm trying to export to the Excel XML format (ISO/IEC 29500-1) which is basically a zip file with a bunch of xml files in it named with a .xlsx extension. I've tried generating apple script and using NSAppleScript to create the Excel file, which works, but is slow and the user has to have Excel instal...

Retain my own classes?

How do I retain classes that I write? ...

How do I add a copyright symbol to a string?

I'd like to add a copyright symbol in part of a UITableView footer. How do I place this symbol within a string in my application? ...

NSXMLParser vs TouchXML/KissXML frameworks?

What is the advantage of using these different frameworks (TouchXML, KissXML, etc) as compare to NSXMLParser? Update: I think there are some other questions which had indirectly asked the same question, so i believe it will be repeat. So i am posting the urls of those questions here. Though i asked the question with some other things in...

NSTimer : applicationDidEnterBackground : countdown (how to keep state)

I have a simple countdown timer that updates a label every second. How do I keep state or the illusion of it when hitting the home button or when the app gets put in the background? ...

Question about NSMutableArray

If I have a NSMutableArray: NSMutableArray *principalTable; and I have a other NSMutableArray: NSMutableArray *secondTable; and I do this: [secondTable addObject:@"string"]; [principalTable addObject: secondTable]; [secondTable removeAllObjects]; The principalTable has 1 object, but this object has nothing inside. So my questi...

Application behaves differently when output is redirected to an NSPipe object?

I have an application which works with sockets and reads / writes data. It uses Foundation framework combined with CFNetwork and stdio. Here is the issue - when it is launched from console (bash shell) it works 100% fine and there is nothing wrong with. However when it is invoked by another application via NSTask madness begins. The who...

Simple TableView Question

Hello, Is there any way to make it so that the user cannot swipe-to-delete items? I can't find this property anywhere!! This is Objective-C xCode iOS Thanks, Christian Stewart ...

Objective-C TableView Select Item Troubles...

Hello! I'm having trouble having my app respond when an Item is selected in the table view. I'm running everything from my app delegate (the table functions that is like dataSource and TitleForHeaderAtSection etc) which are all being called fine. However it is not calling my selection method when I tap on a item in the list. I even put ...

How do you store (x, y) coordinates in an array using Objective-C?

I have an Objective-C method which uses some x and y values from an image: image.center.x and image.center.y. I want to store them away every time this method is called, so I was hoping to use an array. How can this be done? I suspect using an NSMutableArray? ...

Core Data Relationship Failing to Load To-One Relationship

I have a to-one relationship between a Document and Settings model: On creation of a Document, a corresponding Settings object is created. The models are persisted to core data. When relaunching after creating a few documents (and the associate settings), the application reloads a list of documents to select using: // Load delegate ...

Animating UINavigationBar

I want to slide the right button and the title in and out (instead of having things just appear and disappear). How can I go about doing this? ...

How to get high scores from OpenFeint?

Hi In their support OpenFeint give you this, but I don't quite understand. How can I get the leaderboard data, say top 10 and show it in my own UI? Original link: http://www.openfeint.com/ofdeveloper/index.php/kb/article/000028 [OFHighScoreService getPage:1 forLeaderboard:@"leaderboard_id_string" friendsOnly:NO silently:YES onSuccess:...

PreferencesViewControllerDelegate

I found this in some example code I downloaded #import "PreferencesViewController.h" @class MetronomeView; @interface MetronomeViewController : UIViewController <PreferencesViewControllerDelegate> { MetronomeView *metronomeView; } @property (nonatomic, assign) IBOutlet MetronomeView *metronomeView; - (IBAction)showInfo; @end ...

Initialization order of static variables

I'm trying to confirm whether static variable initialization in Objective-C works the same as it does for C++. Specifically do static variables have the possibility of being instantiated/created before main() is called? ...