objective-c

Preventing multiple buttons from being touched at the same time

In iOS is there anyway to prevent a UIView containing multiple buttons (siblings) from being simultaneously from being touched? For instance, two non-overlapping buttons that are side by side can be tapped at the same time with two touches. ...

playing a sound, waiting it to finish playing and continue (iphone)

Hi guys, i'm new with the iphone and objective c, so far, I have been able to code some small examples. i would like to play a sound and, continue with rest of the code when the sample finishes playing, i.e: printf("hello"); playASound["file.wav"]; printf("world"); actually i'm getting: print hello, play the file and print world at ...

NSClassFromString Case Insensitive Objective-C

I am attempting to instantiate classes from different XML sources. The cases of the class names are inconsistent (camel, upper, lower) across these sources. Does an equivalent to NSClassFromString exist for this? For example, something allowing for: Person *person = [[NSClassFromCaseInsensitiveString("Person") alloc] init]; Person *pers...

How can I format a movie to play through MPMoviePlayerViewController on the iPad?

Hi guys, I've been struggling to make video on the iPad work. I'm using an MPMoviePlayerViewController and it plays fine in the simulator. I've tried several different converters, including ones dedicated to producing iPad-formatted video, but none of the videos play on the device. The MPMoviePlayerViewController loads and the controls ...

iPhone TableViewCell with dynamic height crashing.

I've been trying to create a TableViewCell consisting of 2 UILabels in the first row, and another UILabel in the second row. The layout of frames & labels works correctly in the simulator. However: 1) The height is not dynamically increasing / decreasing with each cell 2) The Table crashes whenever it is scrolled in the simulator Ca...

Problem with NSMutableArray and custom NSObject

Hi, I'm really desperate on this one. I'm trying to make a Framework which you can search and play YouTube videos with. But while testing it, I'm running in to a big problem. In the search operation I'm adding YTVideos (a subclass of NSObject) to a NSMutableArray. When I loop thru it in the main(), I'm getting nil-objects: Method - (N...

Zooming within pagingScrollView

A follow on from the question I asked yesterday. I have a paging scrollView that only pages in the y-axis. At the moment I have it working that I have an array of UIImageViews containing different UIImages and the photoScroller works as i'd expect but when I try to add the imageView as a subview of another scrollView to allow pinching a...

Asynchronous Callbacks to Dismissed Viewcontrollers?

Have noticed issue while testing iphone app that if one quickly opens/dismisses a modal view which contains asynchronous http calls the app eventually freezes up with a EXC_BAD_ACCESS message. I'm relatively confident that there aren't any memory leaks in either the modal view or the viewcontroller that's launching it (at least none tha...

UIButton.titleLabel clipping text problem

Hope I can get some help with a rather obscure problem with UILabel. I keep getting problems with clipping of characters. The font in the image at the link below is baskerville-bolditalic. The yellow is the rect that the UIButton is rendered in. The yellow is the UIButton's titleLabel.backgroundColor. http://img5.imageshack.us/img5/2381...

Dragging Out of a Table and Responder Chain

Hello everyone, I'm trying to build something where I can drag a person object from a UITableView into another UITableView. What I've got working so far is that when I select the item in the table to drag (UICustomTableViewCell), in the touchesMoved method, I pop the person object out of the cell and attach it to the superview. The p...

Is it possible for my app to install default image set as an album on the iPhone?

I'm creating an app that will use UIImagePicker to let users pull custom images from their Camera Roll. However, I also would like to include a set of my own images with the app, so that users have the option of using those. I'm wondering if on the first install of my app there's a way to put those default images in their own album insid...

how to add object to NSMutableArray

Hi Everybody, I am trying to read an input file (if it exists) and then want to add a string to that input. My code looks as follows. NSMutableArray *listData = [[NSMutableArray alloc] initWithContentsOfFile:*filepath*]; // listData = null if the input file does not exist. NSString *jobName = [NSString stringWithFormat:@"My New Job"]; [...

Box2d Calculating Trajectory

I'm trying to make physics bodies generated at a random position with a random velocity hit a target. I gleaned and slightly modified this code from the web that was using chipmunk to run in Box2d + (CGPoint) calculateShotForTarget:(CGPoint)target from:(CGPoint) launchPos with:(float) velocity { float xp = target.x - launchPos.x; ...

How to base64url Encode Strings in Cocoa Touch

Is there a library function/method/class in Cocoa Touch for base64url encoding strings? ...

UITableView cell coordinates

hi, There is any way to get cell coordinates when pressing on cell? I have UITableView and i want to show the activityIndicatorView on the cell that was pressed and for that i need the cell coordinates. the didSelectRowAtIndexPath method dont provide this information. one more thing , when i show the activityIndicatorView i want from ...

iphone how to I make a uitableviewcellaccessorydisclosureindicator background transparent?

Can someone please explain to me how I can make a uitableviewcellaccessorydisclosureindicator's background in a UITableViewCell transparent? Right now I'm facing this problem: ...

Call an IBAction

Can i call a IBaction from this - (void)runScheduledTask { } i wish to call this IBAction: (IBAction)GetSms { } ...

Handling multiple alert views in iPhone/iPad application

Hi All, I am working on an application that involves communication between two devices. When device#1 seeks to communicate with device#2, it first sends a request message. Upon receiving the message, device#2 informs the user that a person wishes to communicate with it. If the user is interested in receiving the data, he choses Yes ot...

Exposing C function from custom Objective-C Framework

I'm attempting to write my first custom Cocoa Framework and I want to expose a simple C function from the framework that wraps up a bunch of functionality, much like NSApplicationMain does. When I simply imported the files directly from within the project, everything went fine, the project built and my C function was called correctly. N...

Can't use __objc_msg_forward on x86_64

No matter what I do I can't get __objc_msg_forward to work on x86_64 on Linux. If I compile with -m32 it works fine. I put together this simple program to demonstrate. It should print Crasho Barfo twice. #import <objc/Object.h> #import <objc/objc-api.h> #include <stdio.h> #include <stdarg.h> #include <stdlib.h> @interface Object (Test...