objective-c

add different characters to a NSString one by one??

i am retrieving different characters from a string by using thsi function and adding 5 to them to display the corresponding character for eg. 'a' displays 'f' and 'h' displays 'm'.. but the problem is that i am not able to add these characters into a string which i can use to display to display like 'fm'...can anyone help?? heres the cod...

Adding custom UITableViewCell crashes the simulator.

Im trying to build my application using a custom UITableViewCell. This is the code in my UIViewController that adds the viewCell to the table: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"------- Tableview --------"); static NSString *myIdentifier = @"MyId...

Core Data: Overkill for simple, static UITableView-based iPhone App?

Hello! I have a rather simple iPhone app consisting of numerous views containing a single, grouped table view. These views are held together in navigation controllers which are grouped in a tab bar. Simple stuff. My table views do little more than list text (like "Dog", "Cat" and "Weasel") and this data is being served from a collectio...

Code for terminating application on button click ( in iPhone ).......

I need code for terminating the application on a button click but termination should be done with basic animation....Can anyone suggest? I tried with exit(0) and also by using [[UIApplication sharedApplication] terminate]; but it terminates application roughly......... ...

How do you create a simple Objective-C command line project in Xcode

I'm moving from a C# VS2008 world into the Mac world and I just wanted to know how I can create a quick little command line based application so that I can write many little Objective-C apps without worrying about creating an iPhone app or whatever. Which projects do I create in Xcode? I can see the Command Line Tool under "Mac OS X" bu...

Update Query using the Objective C Wrapper for sqlite

Hey I am using the http://th30z.netsons.org/2008/11/objective-c-sqlite-wrapper/ wrapper . My code is this : - (IBAction)UpdateButtonPressed:(id)sender { Sqlite *sqlite = [[Sqlite alloc] init]; NSString *writableDBPath = [[NSBundle mainBundle]pathForResource:@"Money"ofType:@"sqlite"]; if (![sqlite o...

Design views in IB and use them few times with different content?

hi, is it possible to design a view in interfacebuilder and use it dynamically a few times? the view structure is - UIScrollView - UIView - UIImageView - UILabel now i want to dynamically create multiple instances of the UIView in a for loop with different UILabels and UIImageViews. I want to give them side-by-side in the...

how to get NSTextField in custom NSFormatter class

i am new to cocoa and objective-c and creating small application having few NStextFields on the window.I have create custom NSformatter to validate the inputs,at some instance i want to get the NStextField within my custom NSformatter to change its backcolor to red to notify user for wrong input value.I didn't getting how to get the curr...

How to calculate the height of the text rectangle from an NSString?

I know there is this one: sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode: But since the CGSize always has the same height and doesn't adjust to any shrinked text or whatsoever, the CGSize is not telling how heigh the text is. Example: Make a UILabel with 320 x 55 points and put a loooooooooooooong text in there. Let t...

Textfiled delegate in MFMailComposeViewController Class

I have used MFMailComposeViewController class in my iPhone app for email functionality.When I try to fill email body keypad comes.Here How can I use resignFirstResponder for that email body textfiled in MFMailComposeViewController class... ...

Stop Core Location updates then restart them with a timer

I was wondering if anyone could point me to (or paste in) some code to deal with turning off Core Location updates to save power. As far as I understand it, you should stop Core Location updates as soon as you get a reading of desired accuracy. If you don't get a good accuracy reading after a certain time, you should also stop updates (...

How to get call notification using mobile substrate on iphone?

Hi all, I want to use mobile substrate to "hook" some code into IPhone's "MobileCal" app so that the injected code will send a notification to my app MobileCal gets a call notification. But I'm out of luck and no clue which method need to be replaced by my "hooking" method in the "MobileCal" app. For example, the "MobileLog" and "iReal...

Must I import my category header file every time I want to use that additions?

For some reason the compiler gives me a warning that my category methods may not be there (like "foobar may not respond to doFoo"). However, the category works. ...

Objective c: How to use memory managment properly for asynchronous methods

I need to call a method that starts some asynchronous code MyClass* myClass = [[MyClass alloc] init]; [myClass startAsynchronousCode]; Now I cant simply release it as this would cause an error since the code is still running: [myClass release]; // causes an error What is the best way to deal with the memory? ...

How do I access a REST API on the iPhone?

So I'm brand new to rest's API and have never used an API ever before. I'm ok with Objective-C and Cocoa Touch but just have no clue where to start when accessing the API and how to in general. Can someone help me get started with some code that will access titles in rest or just how to access a REST API in general with authentication. T...

Elegant way to get all objects of a specific type in an Objective-C array

I know I can do for (id obj in array) { if ([obj isKindOfClass:[Elephant class]]) [elephants addObject:obj]; } but I feel there must be a more elegant way of doing this. I've looked at filtering arrays but can't come up with a good predicate. Thoughts? ...

How do I add custom pins to the iPhone MapKit?

Hi, I'm testing out the MapKit framework on the iPhone and would really much like to switch the standard pin that displays a location to an image called "location.png". How can I modify my code to allow that? Maincontroller - (void)viewDidLoad { [super viewDidLoad]; // // Set the map center // CLLocationCoordinat...

iPhone Development: Use POST to submit a form

I've got the following html form: <form method="post" action="http://shk.ecomd.de/up.php" enctype="multipart/form-data"> <input type="hidden" name="id" value="12345" /> <input type="file" name="pic" /> <input type="submit" /> </form> And the following iPhone SDK Submit method: - (void)sendfile { UIImage *tempImage = [UIImage imageN...

PHP's openssl_sign generates different signature than SSCrypto's sign

I'm writing an OS X client for a software that is written in PHP. This software uses a simple RPC interface to receive and execute commands. The RPC client has to sign the commands he sends to ensure that no MITM can modify any of them. However, as the server was not accepting the signatures I sent from my OS X client, I started investi...

my DetailViewController has text field. It appears empty at my first tap after that ...

I have a table view which has full of items getting from my database. I open my app. I tap one of my items in table view, then DetailViewController that has only text field does not display anything it is empty. But when I go back to table view then tap any other item again , at this time it displays value what I wanted to display.. It d...