objective-c

Convert basic script to Objective C (money formatting)

Hello, I've got this basic like script that I need to convert to objective c, it turns big units of money into shortened versions (ie: 1.2m, etc), I've got most of the conversion done, but the biggest problem I'm having is right at the end. The original basic code is: ; Basic Code Function ShortCash$(BigNumber) out$="" ; First, ...

how to detect USB insertion in imac?

how to detect USB insertion in imac using objective c? im trying to write an app running in background to detect if there is any usb being inserted to the imac. is there any code to do that in objective c? ...

Searching NSArray for an object

I have NSArray consisting of NSDictionary objects. Need to find index in NSArray of object with matching key name in NSDictionary. Dictionary has only 1 element. What is the fastest way of doing that? Filter with predicate and then use indexOfObject? ...

Android and Objective-C

I'm completing a project for the iPhone entirely written in Objective-C. I'd like to translate this for Android too. While the user interface of the iPhone and the Android OS are very different and will need different code, can I some how import the core of my code (ie. the black box that does the thinking) as is to Android as part of s...

Handling touches

I have a UIView subclass with several subviews and I want to handle these events in the class: touchesBegan:withEvent: touchesMoved:withEvent: touchesEnded:withEvent: but I also want these event to be called at the subviews. How can I accomplish that? (I have already tried with hitTest, but I only get the touchesBegan event and no t...

CALayer causes memory leaks?

Hello, the following code makes my app slower as a snail (it causes a memory leak i think): CALayer *layer = [[CALayer layer] retain]; detailcell.layer.borderColor = [UIColor grayColor].CGColor; detailcell.layer.borderWidth = 2; detailcell.layer.shadowColor = [UIColor blackColor].CGColor; detailcell.layer.shadowOpacity = 1.0; detailce...

Objective-C NSDate - How to Get the Current Date From a Different Time Zone

I've been browsing the Apple docs for a while now, but haven't seen a way to get the current Date from a different time zone. Basically, I need to get the current date in US Central Standard Time (CST). I'm pretty sure it's a combination of NSDate and NSDateFormatter by setting the time zone. I'm sure this is an easy task, but I haven't ...

Is it possible to animate the width of a UIButton of UIButtonStyleCustom type?

I have an animation on frame size which works fine when the UIButton is a UIButtonTypeRoundedRect. But has no visible affect when I am using a UIButtonStyleCustom with background image. My animation code is here: [UIView beginAnimations:@"MyAnimation" context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAni...

iPhone Dev - need a id from the last view i visited

I need to build a code to track what id i use from an order view, but now i can't get it to work, can somebody paste a sample code to me? i need a TagID from view1 -> view2, so when i'm landing on view2 i can get informations about it and send to users screen. i hove on a little help here :0) ...

How do I track the download progress of gzip encoded web content?

I'm writting an iPhone client that downloads stuff from the net. Since the cellular network is not so fast, and files might be big, I wanted to improve upon the activity spinner with a progress bar. So far so good, I'm using NSURLConnection and checking the Content-Length header to see how many bytes I will download. Then, in the didRec...

Retrieving the UIImage of a TTPhotoViewController

Hello I have a TTPhotoViewController subclass working nicely. I need to be able to give the option of saving the image downloaded to the user's saved photos directory. But I am having problems actually retrieving a UIImage object from where I am After looking through the API I have seen that TTPhoto (which is one of the properties of t...

UISomethingView for formatted scrollable append-able text

I was wondering if someone could suggest the correct control to use for displaying rich formatted text on an iPhone. The requirement for this text is kind of like a log file where as things happen in my code they will be appended to the bottom of the scrollable log on the iphone screen in a view. Its important that I can use different ...

Audio playback does not start

NSError *err; // Initialize audio player audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&err]; audioPlayer.delegate = self; [audioPlayer play]; With the code above, I'm trying to initialize playback of a .mp3 file, however the playback does not start at all. There is no sound. What am I doing wrong? I have inspe...

How to register mac for distributing my iphone applications

Hi all, i have developed a music application .i have run it in ipod .It is working properly .but now i want to distribute my application.For that i need to register my mac pc but my mac pc is not registered.So,please anybody help me or give any hints in how to register my mac pc for distributing my iphone app when i am running my appli...

Why am I seeing the following exception within my application?

Hello! I'm creating an iPhone application. I have two view controllers (the main one and an about window). In the about view controller i have a UIButton which is linking to a IBAction in the view controller. I'm getting: 2010-08-05 21:40:05.741 appname[9151:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentExceptio...

how to convert integer to string in objective c

Possible Duplicate: How to convert from int to string in objective c: example code Please tell me how to convert integer to string in objective c. I want to make an array and want to put integer into it ...

Whats the best way to have an iPhone app to pass data to a website?

I am in the process of building my first iPhone app (xCode,objective-c) which has to communicate with an existing website using either a web service or WCF service. I have looked primarily at using a WCF service hosted in the website which can send and receive JSON (making it lightweight as opposed to the overhead of SOAP). However I am ...

Memory Leak in Propertylist Serialization

Hey Guys, Now it's time for me to ask a question. Until now I just ignored that Memory Leak. But now it's to find out which object leads to this leak. I have the following code: NSDictionary *addressDic = [[NSDictionary alloc] initWithDictionary:[NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:NSPropertyLi...

PEXPECT with HOWIE (pyaiml chat bot) to make OBJECTIVE C gui to replace terminal

So I want to make a nice objective c GUI for HOWIE. Can someone show me how to use PEXPECT to communicate with howie? I don't want to use terminal, I want to use my gui as the interface. ...

PresentModalViewController: Where to release?

To use presentModalViewController I must alloc and initWithNibName:bundle: a view. My question is: where do I release it? Does the dismissModalViewController:animated: handle the release? ...