objective-c

Problem with NSTimer

Edit2: Why only progress got updated in "doSomething" method but not point0? Edit: with the code I have. I know I must overlook something, but I just could not find it. I am writing an iphone app which uses NSTimer to do some tasks. In the program, I could not get the updated value of the variable updated inside NSTimer loop. Here is m...

Dialing a number

I read some reference about how to make a call programmatically on the iPhone, so I put this in my code : UIApplication *app = [UIApplication sharedApplication]; NSString *urlString = [NSString stringWithFormat:@"tel:0225225657"]; NSURL *url = [NSURL URLWithString:urlString]; [app openURL:url]; is that correct? If yes, how can I know ...

how to overlay an image in iphone application?

I want to overlay an image over a button. the button has a background image. If i want to overlay a semi transparent image over the button, suppose i overlay a red color image, which is semi transparent. Can any one suggest how to do that? Suggest some documentation. ...

NSTableView drag items "count badge"

When you start dragging items in the table view in Mail or iTunes, you see this count badge neatly showing (in a red "starred" circle, or rounded rectangle if the count gets big enough) the number of dragged items. Is there a ready-made code somewhere available for me to do this? Because if it is, it could save me a whole lot of time wri...

how to convert int to NSTimeInteravl in Objective-C?

Hello, Please do tel me how to convert int to NSTimeInterval? Thank You. ...

how to encode/decode of type NSTimeInterval?

Hello, How do i encode and decode NSTimeInterval? when i do it in this way... NSTimeInterval refreshInterval; [coder encodeObject:refreshInterval forKey:@"refreshinterval"]; it throws an error saying , incompatible type How to solve this problem? or the correspoinding thing is to convert NSTimeInterval to int and vice-verse.. but...

Background mode server communication drains battery

I developed an app that makes a photo and submits it with some text to my web service. Now when my app is running (even in a background mode) the battery drains in 4 hours and my iPhone is getting really hot. I thought it may be a problem with the device but after visiting an Apple Store they said the battery is fine and that the proble...

remove the spaces betwwen the tags in local xml file in iphone sdk

Hi I am having an xml named test11.xml now when i pasrse the data into CXML there are spaces in the parsed xml i want to remove these space .. Kindly Find my xml data as below thanks <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?mso-application progid="Word.Document"?> <w:wordDocument xmlns:w="http://schemas.microsoft.c...

Slow down playback speed?

How can I slow down an audio file (for playback only) on Mac OS X, but preserve good quality? I tried using QTKit to slow down audio but the quality is bad. Edit: I'm using this code: QTMovie *audio = [[QTMovie alloc] initWithFile:mediaClipURL error:&error]; // ... (error handling) [audio setRate:0.5]; ...

iPhone app Facebook Picture Upload

Hi all, I have another question. I want to upload a picture to Facebook. I have found some tutorials to do this. I've read that you need to register your app first on facebook. Is this absolutly necessary to test the functionality? My app isn't finished at all and I just want to test if it works. ...

Check for collision of ball in a circular path and a stationary object on the path for iPhone app

I have set a ball on a circular path by animating its layer. When i checked for collision with another object, I tried use CGRectIntersectsRect but to no avail. What is the difference between a layer and the frame? I suspect that the frame is not following the layer animation hence CGRectIntersectsRect is not something that I should be ...

comparing the action in iphone

user can only listen to three songs before he/she has to login or else they won't be able to listen anymore. for that can I compare IBAction like that (if(IBAction < 3)he stop and he have login for more song. This same question as I Ask before I am trying to solve that give me hint to do. thanks in advance ...

Sharing variables amongst 2 ViewControllers

Hello, Here is a simple one for you guys . I'm defining a class to store variables in so I can reuse those variables in different ViewControllers . Here is how I do it, it`s obviously not working ( that's why I'm asking a question ... ): I declare a class : VariableStore.h @interface VariableStore : NSObject { int evTe; } @pr...

Placing items from a Core Data entity into an NSOutlineView programmatically?

Sorry if this seems like a silly question - I am an amateur when it comes to Objective-C and Cocoa and even less knowledgable when it comes to Core Data usage. So here's the situation: I have an NSOutlineView that I've already populated with a few items manually with an NSTreeController. What I need to do now is take the items in one of...

Problem in writing to a file in application bundle.

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectoryPath = [paths objectAtIndex:0]; fileName = [documentsDirectoryPath stringByAppendingPathComponent:@"user.txt"]; NSFileHandle *myHandle = [NSFileHandle fileHandleForUpdatingAtPath:fileName]; ...

Memory allocation in Objective C

I have a simple question. I was referring "Your first iOS application" document by apple.I found that the class has a property called myViewController: @interface applicationClass { MyViewController *myViewController } Now to assign a memory to this pointer, the code shown is: MyViewController *aViewController = [[MyViewController...

How to communicate with web service in JSON and Core Data?

I am writing an application where we communicate with a web service in json. I would love to cache data from this service, so that the user always can show cached data while we are fetching updated data. I have looked into a minor project; Core Resource that is a layer over Core Data. It converts from JSON to data objects, and it looks ...

Character count in MFMessageComposeViewController

Is there a way of showing the character count in the MFMessageComposeViewController? I have turned it ON in the iPhone settings for the native sms app but in my app it does not show it. ...

How to print a short type in NSLog?

print the string is using [NSString stringWithFormat:@"%@", @"String"]; if I want to print integer, I just use %i, what should I do to print a short type? thank you. ...

Possibilities to compress an image (size).

Hi all, I am implementing an application. In that I need to find out a way to compress the image (size). Because it will help a lot for me to making the space comfortable in the database(server).Please help me on this. Thanks in advance, Sekhar Behalam. ...