objective-c

Keep Modal View row checkmarked

I have a RSS parser that displays the articles in a UITableView. I also have a button that brings up a Modal View where you can change the source of the RSS feed. I have 2 questions: 1) How do I keep the selected feed row checkmarked after I quit the app and open it again? 2) How do I call for the article table to reload when the modal...

SnowLeopard Xcode warning: "format not a string literal and no format arguments"

Since upgrading to the latest XCode 3.2.1 and SnowLeopard, I've been getting the warning, "format not a string literal and no format arguments" on the following: NSError *error = nil; if (![self.managedObjectContext save:&error]) { NSLog([NSString stringWithFormat:@"%@ %@, %@", errorMsgFormat, error, ...

Returning Multiple Values from a Function

Hey, so I'm making an iPhone app and in there is a common function that needs to be called. So I put it in it's own file and set it up, passing the parameters to that and all that. However, I'm not sure how best to return the values from the function. I read up trying to return the values in an array, but I'm not sure how to do it. i...

How to display time in seconds in Cocoa efficiently?

I want to display the time (including seconds) in an application in a text field, pretty simple. What I currently do is create a NSTimer that runs every 0.1 seconds that gets the system time and updates the text field. This seems like a terribly inefficient way to accomplish this. Is there a better way? ...

How can I get a method to call in a class while the user is in a view of another class?

I have an iPhone app based on a tabBar and tableViews. I want the user to be able to click on one tab and access options for filtering the data in the initial tableView. The problem I'm having is that while the user is selecting filter criteria, I want the main table (not visible) to update. The reason this is important is that I want t...

Set contents of webview to html string (cocoa)

Hi, Is there any easy way to set the contents of a webview to an html string (without having to load a file)? Thanks ...

iPhone: Get Response From Finished Request [ASIHttpRequest]

Hello all. I am attempting to use ASIHttpRequest with the iPhone to get some information from a query-string based API on my site. Currently, I am in the planning stages of my design and I am kind of stuck on how I should proceed. I would like to have a class, that will handle all of the requests I will need. I plan on having differe...

USB Programming with Objective-C

Can anyone tell me how to program USB devices with Objective-C as an iPhone application? I want to access USB device contents through iPhone ...

Converting String to long long value

Hi, In my application I have to convert string to long long data type and it should also be supported for Tiger OS. So I can not directly use longLongValue on NSString because it is supported for Mac OS Version 10.5 and later. So I am converting string value to long long by the following method : + (long long) convertToLongLong:(NSS...

@interface and @protocol explanation?

I would like to know what the @interface in objective C is? is it just where the programmer want to declare the variables, class name or method names...? I am not sure whether it is like interface in Java. And about the @protocol in objective C as well. It seems like the interface in Java more. Could anyone give me detail explanation ple...

how to trigger function in view from viewcontroller viewdidload method - objective c - iphone

Hi everyone, I'm trying to trigger a function in a view class, from the view controller once it has finished loading. Currently the code I'm trying to run is this GameView *gameView = (GameView *)[[UIView sharedApplication] delegate]; [gameView loadText]; I've borrowed this code from other code which triggers functions on the appde...

Changing Data in a Plist

Hey, alright so I have a .plist that looks like; <plist version="1.0"> <dict> <key>Item 0</key> <dict> <key>Name</key> <string>Jero</string> <key>Initiative</key> <integer>0</integer> <key>EditThis</key> <false/> </dict> </dict> </plist> In the app I have it so that when one of the rows (The data is put in a UITableView) is ...

Relative Height of UITableview

In RootViewController am using a UITableView for displaying the content of data. In the didSelectRowAtIndexPath method, I am calling another view controller (DetailViewController) to display detailed data. For displaying this detailed data I am using a UITableview in the DetailViewController also. This table contains one section and only...

Where to declare an enum struct?

This is just out of curiosity but when i declare an enum type, would it be better to have it within an implementation declaration or outside of it? What would be best practice? For example: @implementation PostQuestionScene enum popUpItems{ kExpiredBox, kPauseBackground }; vs.. enum popUpItems{ kExpiredBox, }; @implementation...

Blowfish objective-c implementation

Hello, What objective-c implementation of Blowfish would you advice to use? (Or may be I just missed some standard implementations available?) ...

Object allocation from class method?

I am just curious if this is right, or bad practice? (i.e. using a class method to alloc/init an instance)? Also am I right in thinking that I have to release the instance in main() as its the only place I have access to the instance pointer? // IMPLEMENTATION +(id) newData { DataPoint *myNewData; myNewData = [[DataPoint alloc] ...

Unable to retrieve selected index from NSComboBox

Im trying to get the selected index of a NSComboBox that has a datasource by using indexOfSelectedItem. [combobox setUsesDataSource:YES]; [combobox setDataSource:dataSource]; [combobox selectItemAtIndex:1]; int idx =[combobox indexOfSelectedItem]; idx will always returns -1; Getting the same results even when defining a internal list...

Cocoa-Touch: Using UITabBarController with multiple tabs as UINavigationControllers

I'm building an app that has 5ish tabs, each of them will have table + item details views. So I have to create a UITabBarController and the items instead of being the direct views are the UINavigationControllers with a default view inside. I've done this, and it works, but.. Isn't this a waste? Looking at what the UITabBarController d...

NSApplicationWillTerminateNotification not received

I have some code that needs to be run when the application terminates. I register my controller for the NSApplicationWillTerminateNotification as follows: [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(applicationWillTerminate:) name: NSApplicationWillTerminateNotification obj...

on iphone, how can i stream several videos one after one?

Right now i am use using mpmovieplayercontroller, but i need to close mpmovieplayercontroller for play another video. Is there a way to play several videos without closing the mpmovieplayercontroller? thx ...