cocoa-touch

Hide Shutter in UIImagePickerController

I have designed an iris shutter animation for a camera view in an iPhone app. Unfortunately, it seems impossible to hide Apple's shutter when the view appears, even if I hide the camera controls and create a custom cameraOverlayView. I have gotten around this by animating my shutter on top of the normal shutter when the view appears, u...

Passing NSMutableArray from Delegate to tableview

Hi all, i have encountered a problem when wanting to pass a NSMutableArray from the delegate to a tableview controller and then reload it's data, I need to do this because i have my socket in the delegate and when it receives data it returns a NSMutableArray which is supposed to be the data for the tableview, unfortunately it passes nil ...

Why does my CAKeyframeAnimation not get executed?

This' my code in which I'm trying to change the size of my imageView. If you can point out any error, I'll be really grateful.. UIImageView *imageViewForAnimation = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ravan.jpg"]]; imageViewForAnimation.alpha = 1.0f; CGSize size1=CGSizeMake(60,60); CGSize size2=CGSiz...

Sound on simulator but not device

I'm using the following to play an m4a file: NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent: fileName]; SystemSoundID soundID; NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO]; AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID); AudioServicesPlaySystemSound(soundID); It w...

How to customize UITableViewCell for string length

I have to fit strings within a table. The strings are of different lengths. The cell of the table should be sized according to string length. I am using sizeWithFont:constrainedToSize: . But I could not use it properly. Can any one please suggest a solution? ...

Displaying bold text from SQLite in UITableViewCell

We're storing text in SQLite and displaying it in UITableViewCell within our iPhone application. UITableViewCell seems to recognize line breaks from SQLite, but not bold text. Any suggestions would be much appreciated. ...

Add both UIBarButtonSystemItemAdd and UIBarButtonSystemItemTrash to one side of a Navigation Item or a UISegmentedControl

Hi there, Well, the title says it all. I'd like to have a UIViewController which has an Add and a Trash button both right to the title, either by adding two UIBarButtonItems to the navigation item/bar or by adding them to a UISegmentedControl and then adding the SegmentedControl to the item. Is this possible? If yes, how is it achieved ...

Question about factory method object lifetimes in Objective-C/Cocoa (to retain or not...)

From reading the memory management docs in the SDK, I gathered that factory methods (static constructor methods) would typically be retaining the object for me and adding it to the autorelease pool? This would mean I have no need to retain & release an object as long as the pool does not get released before I expect? (Which should be at...

UIScrollView not showing scroll indicator

I have a UIScrollView which I create and size dynamically using... scrollView.contentSize = CGSizeMake(scrollView.frame.size.width , length); I then add subviews to the UIScrollView. I do have scrollView.showsVerticalScrollIndicator = YES; When scrolling the scroll indicator never appears. Even if I call [scrollView flashScrollIndic...

Beginners guide to 3D programming in IPhone SDK

I'm thinking of starting a project to make a game, maybe just a simple one, but still a game in 3D for the IPhone. Though i still have a long way to go, learning objective-C and so on, but a question popped in to my mind while thinking of the 3D gaming world. Would i benefit from learning OpenGL(PC/Mac) first before doing games for the...

Why are the corners of my UIImage being cut when I rotate it?

hi all i rotate my UIImage for crop. when i am rotate my image it just cuts from corners here my code. -(UIImage*)imageLeftRotation:(UIImage*) newImage size:(CGSize) imgSize angle:(int) rotateAngle{ UIImage *image = newImage; CGImageRef imgRef = image.CGImage; CGFloat width = CGImageGetWidth(imgRef); CGFloat height = C...

iPhone, get playlists from Cocoa Touch

How i can get list of user playlists from code? In CocoaTouch. ...

Getting a specific song from a specific playlist

Let's say i want to order by name all songs from a specific, say "My playlist", Playlist, and play song 100 in that playlist. Is it possible at all? ...

NSSortDescriptor and nil values

I'm using an NSSortDescriptor to sort NSDate objects in an ascending order. However, I need nil dates to be at the bottom of the list, whereas at the moment they come at the top. ...

Downloading from desktop quicker than direct Internet?

Is transfering a file from the desktop to an iPhone quicker than downloading the same file from the Internet to the iPhone? My app allows users to download video files, which are stored locally on the app. These aren't streamed but instead watched from the iPhone's hard drive once downloaded. The downloads are fairly slow using 3G or ...

Why does Core Data initialization fail when I attempt to do it at these points?

I see how to solve the problem but it bothers me that I don't understand why this doesn't work. I have a UIViewController subclass that uses Core Data, so it needs the NSManagedObjectContext. The controller is loaded from a nib file where it's placed under a navigation controller which is inside a tab controller. I tried doing this in i...

How to detect level audio level of current segment of mp3 playing using AVAudioPlayer

If i am palying a sound using the AVAudioPlayer in the AVFoundation framework (I can already do this), is there any way to detect the current level of the audio playing, like a VU meter that is listening to the mp3 playing. I don't want to detect the audio of the mic, just the file playing. I want to animate a mouth to prerecorded audi...

Resize UILabel text with swipe to delete

I am having some trouble getting my application to properly resize the text of UILabels when the user does a swipe to delete or other type of delete. Currently, the delete button is covering up the text that is in the cell (if it is really long). I would like for them to operate like how SMS (move clipped text down a line) or iPod (del...

Core data / NSFetchedResultsController error

I'm having some trouble with core data / NSFetchedResultsController. I'm not entirely sure where the error is as the message is quite vague. I have an issue with inserting more than one object when the fetched results controller has no objects fetched. The following code will crash with the following error if I try and insert several o...

Unexpected number printed for CLLocation.coordinate.latitude

I have an NSLog statement in my -didUpdateToLocation method which prints the latitude of my location as expected: NSLog(@"%g", newLocation.coordinate.latitude); prints 37.3317 In the same method, i assign newLocation to a CLLocation instance variable for use elsewhere. self.selectedLocation = newLocation; But when i NSLog this usin...