objective-c

UISearchDisplayController

Well, i don't find any good tutorial or anything on the search bar. I don't understand how it works. Can you help me or give me a good link, or a sample code (i see the sample code TableSearch by Apple and it's definitively bad ^^) ...

What does “@public” mean in Objective-C?

After reading a question on @private I understand how that works. However, since all variables default to @protected and you cannot really access a variable without defining an accessor, what exactly does @public do? When would you use it? ...

Fail to save a managed object to core-data after its properties were updated.

I have no trouble to create the object, but updating it fails. Here is the creation code: // Save data from pList to core data fro the first time - (void) saveToCoreData:(NSDictionary *)plistDictionary { // Create system parameter entity SystemParameters *systemParametersEntity = (SystemParameters *)[NSEntityDescription ...

Recommended way to set up xcconfig files

Is there any best recommended way for setting up xcconfig files? Where does the projects related fields go and where do target related go? What about multiple targets? ...

SQLite Step Failed: attempt to write a readonly database , using wrapper

I keep getting an error "SQLite Step Failed: attempt to write a readonly database" when using this code to copy a database: -(void)createEditableCopyOfDatabaseIfNeeded { // Testing for existence BOOL success; NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error; NSArray *paths = NSSearchPathFo...

How do I create an NSArray with string literals?

I'm attempting to create an NSArray with a grouping of string literals, however I get the compile error "Initializer element is not constant". NSArray *currencies = [NSArray arrayWithObjects:@"Dollar", @"Euro", @"Pound", nil]; Could someone point out what I'm doing wrong, and possibly explain the error message? ...

iPhone: Does it ever make sense for an object to retain its delegate?

According to the rules of memory management in a non garbage collected world, one is not supposed to retain a the calling object in a delegate. Scenario goes like this: I have a class that inherits from UITableViewController and contains a search bar. I run expensive search operations in a secondary thread. This is all done with an NSOp...

Call a macro every time any method is called - Objective C

Hi, I wrote a debug macro that prints to the console the passed-in string whenever the global kDebug flag == YES. I need to print out the name of a method and it's classname whenever any method is called. That works fine when i painstakingly go through every method and write the name of the class and the method in a string. Is there ...

shouldAutorotateToInterfaceOrientation & UINavigationController

I'm trying to implement auto-rotation in my application that is basically UINavigationController with lots of UIViewControllers that get pushed onto it. I've copy-pasted this in my first UIViewController (that gets pushed into UINavigationController): - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOri...

How can i put UITextfiled inputs into UITableView every time i add an input in the UITextField?

How can i show the input text from UITextFiled into UITableView and the UITable Updated automatically once the UITextFiled get field by another user? like, one the user get online he should be shown in the UITableView so the other users be able to see who's online i did that already for the room list but!!! this is the the welcome...

iPhone: Grouped tables and navigation controller issues

Hi there, I've set up a grouped table on my app, and pushing to new views works fine. Except for one thing. The titles and stack layout are all weird. Here's the breakdown: I have two sections in my table. When I tap on the first row in the first section, it takes me to the correct view, but the title of the new view is the name of th...

What are the key concepts of Objective-C/Cocoa development?

Experienced Objective-C/Cocoa Devs: What are the key concepts that I should absorb early on that will get me closer to that epiphany moment where it all makes sense and I'm effectively creating solutions with Objective-C/Cocoa? I come from a .NET/Java background so everything I do is based on that paradigm. I don't need deep specif...

Get a string with ascii code objective-c

I have a ascii code, for the letter 'a', and I want to get a string by its ascii code, is it possible with NSString? ...

queued view updates not happening when performSelector afterDelay:0 used

Hi all, I have an app that performs some calculations based on data arriving on a socket or local user interaction. I want to show an 'activity spinner' whilst the calculation happens. spinner = [[UIActivityIndiactorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; [spinner setCenter:self.view.center]...

Accessing elements from an array in objective c

I am trying to access individual elements of my array. This is an example of the contents of the array i am trying to access. <City: 0x4b77fd0> (entity: Spot; id: 0x4b7e580 <x-coredata://D902D50B-C945-42E2-8F71-EDB62222C0A7/Spot/p5> ; data: { CityToProvince = 0x4b7dbd0 <x-coredata://D902D50B-C945-42E2-8F71-EDB62222C0A7/County/p15>; ...

Smooth arcs in quartz?

While developing a rounded rectangle widget I encountered the following problem: path built with arcs looks ugly when stroked. How to make the stroked arcs look nicer? ...

SQLite3 database doesn't actually insert data - iPhone

I'm trying to add a new entry into my database, but it's not working. There are no errors thrown, and the code that is supposed to be executed after the insertion runs, meaning there are no errors with the query. But still, nothing is added to the database. I've tried both prepared statements and the simpler sqlite3_exec and it's the ...

Objective C: Compare timeInMillis with current time

Hello, In my iPhone application, I need to calculate the time difference between the time a message was created on the server, and the time my phone received it. The server (Java) puts in a number returned by System.currentTimeMillis() as metadata along with the message. How do I compare this number with the current time on the devic...

Core Data Predicates with Subclassed NSManagedObjects

I have an AUDIO class. This audio has a SOUND_A subclass and a SOUND_B subclass. This is all done correctly and is working fine. I have another model, lets call it PLAYLIST_JOIN, and this can contain (in the real world) SOUND_A's and SOUND_B's, so we give it a relationship of AUDIO and PLAYLIST. This all works in the app. The proble...

How do you make a UIBarButtonItem animation flip?

In the iPod app on the iPhone there is a UIBarButtonItem in the upper right toolbar that flips between the song and track listings for the album. When you select the button, the button itself does a flip animation. Is there a way to do this with: CGContextRef context = UIGraphicsGetCurrentContext(); [UIView beginAnimations:nil contex...