objective-c

NSDictionary - Don't Copy Values?

I am trying to manage a few animations in my scene using the following method: In a loop, create animated UIImageView, set the on stopped method. Also, store this UIImageView in a NSMutableDictionary. The animation ID is the same as the key in the dictionary. When this animation is stopped, get the animation ID. Use [animations objectF...

Brown noise on cocoa

Hi, How can I create a brown noise generator using Cocoa? BTW Brown noise is similar to pink and white noise and has nothing to do with "The brown note" or anything silly. See http://www.mediacollege.com/audio/noise/brown-noise.html ...

calling 'subviews' method on a cell's contentView increases retain count.

Hi, I don't know what is going on here but I have the following code in my init method: NSLog(@"retain count in init before alloc: %d", [game1CustomEntityInfoControl retainCount]); game1CustomEntityInfoControl = [[CustomEntityInfoControl alloc] initWithFrame:CGRectZero]; NSLog(@"retain count in init after alloc: %d", [game1CustomEnti...

Rotating image using objective C

Hi, I am trying to rotate an image. This I am succeeding in doing. The problem is that when I am clicking down and dragging slightly, the image rotates completely to reach the point where I have clicked and then rotates slowly as I drag the image clockwise. I am concerned to why it is rotating completely to the place that I am dragging....

Performing operations on a double returns 0

Hello There! I have a method that receives a number in a NSString format. I wish to convert this string to a double which I can use to calculate a temperature. Here's my method. NSString *stringTemp = text; // text is a NSString NSLog(@"%@",stringTemp); // used for debugging double tempDouble = [stringTemp doubleValue]; NSLog(@"%f",...

How does one use multiple files with an AudioQueue?

Hey everyone, I'm just looking thought the apple iOS example "SpeakHere" http://developer.apple.com/library/ios/#samplecode/SpeakHere/Listings/Classes_AQPlayer_mm.html%23//apple_ref/doc/uid/DTS40007802-Classes_AQPlayer_mm-DontLinkElementID_12 and I was wondering what's the best approach for using the above, but with two audio files, so ...

UILabel is not displaying the correct string

Hello! I have a UILabel I created on one of my views in my application. I have it set to a static text in IB, but I'm going to change that text programmatically. Here's how I was trying to do it. fahrenheitLabel.text = (@"Temperature: %@", text); //fahrenheitLabel is my UILabel //"text" is a NSString I expected the output to be ...

Passing parameters to the method called by a NSTimer

How can I pass a parameter to the method called by a NSTimer? My timer looks like this: [NSTimer scheduledTimerWithTimeInterval:4 target:self selector:@selector(updateBusLocation) userInfo:nil repeats:YES]; and I want to be able to pass a string to the method updateBusLocation. Also, where am supposed to define the method updateBusLoc...

UIInterfaceOrientation Problemer

UIViewController A , B. A implements Horizontal screen , A turn to B. how do what? cancel Horizontal screen for B. B code : - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return NO; } Is not ok! Why?? Please help me ! thanks! ...

Integrating iPad/iPhone App with Rails Application

Hi all, I'm a student working on a project where a need to integrate my iPad (or iPhone) application with a Rails Web App, populating the database from the iOS side and displaying the contents in the web app. I've found ObjectiveResource, but I've had difficulty getting it up and running (went through the getting started, and had the si...

UIViewController and UITabBARController

When I first launch the apps, I want it not to show the tab bar. Then after the user logins, it brings the tab bar. So how can I do this? Do I just hide the tab bar at first place then after the login succeed I will show the tab bar or I should have a UITabBarController inside the UIViewController for the first time? ...

Is there a way to construct an object automatically from an NSDictionary?

I'm building an iPhone app that communicates with an external server via JSON. The JSON library I'm using parses the response string from the server into a dictionary. Currently I've got a method that I've written that just uses hardcoded strings as keys for the dictionary in a constructor I've written called initWithDictionary:(NSDictio...

Tips for finding and debugging abandoned memory and heap growth

I recently watched one of the WWDC 2010 videos: Session 311 - Advanced Memory Analysis with Instruments. The link is here. There is an interesting example in the video on finding Abandoned Memory. They say that it is often more important to debug than leaks but can be more difficult. Abandoned Memory is defined as "Accessible allocate...

Change current screen in TabBar Application on IOS app

Hi. I've created a tabbar application using the template in Xcode, and have setup a working tab bar application. I want to know how I can change the view currently on the screen using a UIButton, so the result is the same as if the user just clicked one of the tabs. ...

Deep combine NSDictionaries

I need to merge two NSDictionarys into one provided that if there are dictionaries within the dictionaries, they are also merged. More or less like jQuery's extend function. ...

private application for iphone

hi guys, one of my client want an private application for iPhone. actually what my client need is, they want the application only for their company employees they are not interested to go for the app store for this. their company has 100+ employees. is it possible to sale the application without the app store. if its give me the ...

pasing complex string on iphone

i want to parse this string appDelegate.gpsArray= "\n\n 21.318\n03.863\n\n\n 21.317\n03.864\n\n\n 11.316\n113.864\n\n\n" so that i cant get value like 1) a[0]=21.318, a[1]=03.863,a[3]=11.317,a[4]=113.846.... or how to get this as 2d array like 2) a[0,0]=21.318,103.863 a[1,1]=21.318,103.863 i did this but of no use NSMutableArray...

How to assign string in a variable as a title for button?

Hello all. In my app i need to assign a string as a title for the uibutton. How can i do this.For example NSString *date=[[NSString alloc]initwithString:@"Todays Date"]; //am trying to assign the date content as a title for my button [Button setTitle:date state:ForNormalSatate]; How can i set title as "Todays Date" for the button ...

How to pass string to double from NSMutableArray.

In array I do have two values value1="234.3423" value2="12.60348" i need to pass this value to varable double x, double y; How to do this Thanks in advance. ...

Programmatically autoresizing UITableViewCell containing several subviews

I have a UITableView, which tries to look like a grid: that is I imitate four columns by adding UILabel**s as **cell.contentView subviews. Three of these "columns" have fixed width, and on rotation I want to automatically resize the leftmost column to fill all available space (width of screen minus overall width of three other columns). ...