cocoa-touch

Cocoa beginner needs help using stuff in an NSArray

I am getting tricked up with arrays and nested arrays. I would like this if statement to evaluate to True if lastObject doesn'texist, or if accelerometer.x - lastObject[0] > .1 My code doesn't do this. if (![accelerometerArray lastObject] || [NSNumber numberWithDouble:acceleration.x] - [[accelerometerArray lastObject] objectAtI...

MGTwitterEngine - Using getImageAtURL on iPhone

Essentially, I'm working on asynchronously downloading images and adding them to specific UITableView cells (twitter profile images using MGTwitterEngine from Matt Gemmell). I've looked at general asynchronous download code and must admit, I'm still too much of a noob to understand it well enough to adapt it to my purposes. Instead, I'm...

Creating an NSDictionary

In the following code, the first log statement shows a decimal as expected, but the second logs NULL. What am I doing wrong? NSDictionary *entry = [[NSDictionary alloc] initWithObjectsAndKeys: @"x", [NSNumber numberWithDouble:acceleration.x], @"y", [NSNumber numberWithDouble:acceleration.y], @"z", [NSNumber numberWithDouble:accele...

Can UILabel's drawTextInRect method be overridden to change the size of UILabel's text?

Apple's documentation for drawTextInRect seems to indicate this is possible: "By the time this method is called, the current graphics context is already configured with the default environment and text color for drawing. In your overridden method, you can configure the current context further and then invoke super to do the actual draw...

Activity indicator in a UITabBar application on the iPhone

Hi, I have a UITabBar + UINavigationController application which often needs data from the internet. Sometimes it takes quite a while before it gets it, so I would like to show an activity indicator. What I was trying is to add a activityView to my window in my applicationDidFinishLaunching method: [window addSubview:tabBarController....

NSURLConnection delegate didReceiveData trailing characters in data

I've really struggled to figure out why my web service call is riddled with junk data. I have a UITableViewController that calls the web service and also acts as the NSURLConnectionDelegate. Here is the delegate method of interest, note the NSLog statements. - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)d...

Reference from UITableViewCell to parent UITableView?

Is there any way to access the UITableView from within a UITableViewCell? (if the cell belongs to that tableView? ...

Waveform API from Apple commercial?

In the new iPhone 3GS commercial, Apple shows voice control with a cool blue waveform animation. Is this visual effect for rendering the waveforms (or maybe just volumes) available as an API call or source code somewhere? (Not the voice control part, just the audio visualization) I think you could get the sound info from AVAudioPlayer's...

Amr Encoder for Iphone

Hi , I was trying to find an AMR Encoder for Iphone That I can integrate with my Voice recording application. Thanks, ...

How do I get the touch location of a different view?

Touch may specify self to get the touch location in its own coordinate system but how do i get it from another? Say another UIview's coordinate system? - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [UIView beginAnimations:@"box" context:nil]; [UIView setAnimationDuration:1]; [UIView setAnimationBegins...

Accessing UILabel Outlet without user interaction

Hi, I'm having an issue with an iPhone app I'm working on. It uses a separate class called Radio which streams a station in. When the title of the stream is updated, it calls back to RadioViewController with the method updateTitle: - (void)updateTitle:(NSString *)newTitle { NSLog(@"update title called with title: %@", newTitle); ...

Applying multiple transforms to a UIView / CALayer

Is there any problem applying multiple transforms to a UIView and it's corresponding CALayer? Specifically, can you "mix and match" CATransform3Ds with CGAffineTransforms without running into issues? Also are there any problems with setting some transforms directly while animating another transform change simultaneously? Are there any...

Hold on a UIButton + Move a Object

I have a problem. Theres my View, with 2 UIButtons and an UIImageView. When a Button is pressed down then i want to move the Image, when it isn't touched down, I want to stop the UIImage. But I have no idea how this works. Maybe you can help me. Here's my Code: - (void)viewDidLoad { currentPositionx = 150.0; currentPositiony ...

Do an action when a sound has finished playing in AVAudioPlayer?

I am using the AVAudioPlayer framework, and I have several sounds that play one at a time. When a sound is finished playing, I want the application to do something. I tried to use audioPlayerDidFinishPlaying to do the action at the end of the first sound, but I couldn't use that for the second sound because I got a redefinition error. ...

NSTextDidEndEditingNotification causing error

Hi. I'm have a TextViewCell with a text field that that I'm using in a tableview. I need the current view controller to be the delegate. Nothing worked and in my searches I found the code below, which I implemented in my initWithNib method: NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selec...

My table cells don't highlight immediately when touched

Hi, In my app, I have a table view that has about eight cells. There is a navigation bar at the top. When a user touches a cell, nothing happens for about 1/2 second. Then the touched cell highlights blue and immediately the new view slides into position. The problem is that there is no feedback to the user about which cell he touched u...

Adding an element to an array from another class

This is probably an easy question but this is the first time i've encountered this. I have a modal view controller that I am getting a string from and need to add that string to an element of an array that is in another class that is calling the modal view controller. How do I pass and add that element from another class? Thanks... ...

Performance penalty for using NIB files?

I am curious to know if anyone has any experience comparing the load time performance of iPhone apps with views laid out in NIBs vs. views laid out entirely programmatically (i.e. instantiating UITextView, adding it to the view, instantiating UIButton, adding it to the view…). If I want a simple app to load lightning fast, would it be b...

Do I need to set these variables to nil in viewDidLoad as I have in this code?

- (void)viewDidUnload { self.GPSArray = nil; self.accelerometerArray = nil; self.headingArray = nil; self.managedObjectContext = nil; self.locationManager = nil; self.pointLabel = nil; self.accelerometerLabel= nil; self.headingLabel= nil; self.startStop = nil; self.lastAccelerometerReading = nil; self.lastGPSReading...

CATransform3DMakeRotation symbol not found

I've included: #import "QuartzCore/QuartzCore.h" but when I try to build, I get the error mentioned in the title. Is there something else I need to do to tell XCode to include the framework? The code where I use it is: CALayer *layer = paperView.layer; CATransform3D rotation = CATransform3DMakeRotation(1, 0, 0, 1); ...