I have a method
-(void)myMethod:(MyObject*)obj
And I am detaching a new thread
[NSThread detachNewThreadSelector:@selector(myMethod) toTarget:self withObject:nil];
How can I pass a MyObject* through @selector(myMethod)?
...
I'm using three20 for most of my iPhone app.
One of the views I need to create is relatively complex. It needs a top bar (under the nav bar) with some controls and label, an image view below this bar (which occupies most of the body) and another bottom bar with more controls and labels (above the tab bar control).
I don't have much UI e...
in my code:
#import "MyViewController.h"
#import "AVFoundation/AVAudioPlayer.h"
- (IBAction)playSound{
AVAudioPlayer *myExampleSound;
NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"];
myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExampl...
-(IBAction)playSound{ AVAudioPlayer *myExampleSound;
NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"];
myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL];
myExampleSound.delegate = self;
[myExampleSound play];
}
I want to play...
Hi !
I have an UITextField and I just would like that every tap on a character, the first character is deleted. So just have one character in my textField every time.
Moreover I would to to display every tap in the console log.
Have you got an idea?
Thanks!
...
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *err = nil;
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&err];
if(err){
NSLog(@"audioSession: %@ %d %@", [err domain], [err code], [[err userInfo] description]);
return;
}
[audioSession setActive:YES error:&err];
err = nil;
if(err){
...
I'm trying to deal with the situation where a user has enabled contacts syncing from multiple sources - e.g. mobileme and an exchange account. Is there any way to distinguish to which account a contact belongs when accessing contacts through the ABAddressBook framework (or through other SDK means)? I can currently only get data for ALL (...
I add an UIScrollView in an UIView whose controller is UIViewController *controller1;
Now, in an function of another UIViewController, I modify the UIScrollView's frame,the code is following:
-(void)controller2Function {
CGRect rect = CGRectMake (10,20, 100, 100);
controller1.scrollview.frame = rect;
}
after invoke the functio...
I am just looking at sorting an NSArray of NSNumbers into numeric order but am a little unsure of the best way to go. By my way of thinking 001 and 002 are pretty comparable, so I would suspect either will do. For 003 I am not sure if returning NSMutableArray when the method expects NSArray is good practice, it works, but it feels awkwar...
I am detaching a new thread
[NSThread detachNewThreadSelector:@selector(loadAvatar) toTarget:self withObject:nil];
I am getting an EXC_BAD_ACCESS on
STObject* st = [cellitem get:@"stobject"];
In my following method
-(void)loadAvatar
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
STObject* st = [cellite...
Is there a way construct a predicate to filter by class type?
I currently loop through the array and check to the class of each object. Maybe there is a cleaner way?
...
For example, this method from NSCalendar takes a bitmask:
- (NSDate *)dateByAddingComponents:(NSDateComponents *)comps toDate:(NSDate *)date options:(NSUInteger)opts
So options can be like:
NSUInteger options = kCFCalendarUnitYear;
or like:
NSUInteger options = kCFCalendarUnitYear | kCFCalendarUnitMonth | kCFCalendarUnitDay;
Wha...
Hi everyone,
This is my first post on stackoverflow so please be patient :-)
I have an Json Array of Arrays:
{
"response_type": "ok",
"total_results": 1,
"page": 1,
"total_pages": 1,
"sets": [
{
"id": 2075184,
"created": 1269989599,
"term_count": 5,
"has_images": false,
"terms": [
...
Hi
I'm adding support for right-to-left languages for the UITableView.
now I need to move the AccessoryDisclosureIndicator and AccessoryCheckmark from the right corner to the left.
I'm taking the UIImageView path and Now I'm looking for 2 png icons: one for the AccessoryDisclosureIndicator arrow to the left and the second for the Acces...
Hi
I have view controller, into the view i have put a table view, and a search bar into the table's header... the search bar is not showing up, just the empty table view.
Do i need to do something additional? I'm pretty sure its to do with the view outlet of the UIViewController, set to View...
Thanks
...
I'm using quartz to display pdf content, and I need to create a table of contents to navigate through the pdf. From reading Apple's documentation I think I am supposed to use CGPDFDocumentGetCatalog, but I can't find any examples on how to use this anywhere. Any ideas?
...
I'm trying to draw a normal rounded rect UIButton, but without the border. Ideally I'd like to be able to change some setting on the UIButton to disable the border.
My problem is that if I change the button type to "custom", I don't get the nice blue selection gradient (which I want to keep), and I have no idea how to draw it manually....
Hi
I want to be able to use the search term from a UISearchBar as input to a web service, retrieve the results (JSON), and then display the results in the table view underneath the search bar.
Is this possible / a good idea / is there a better way to achieve this?
I have tried several ways, can manage to retrieve the JSON correctly, b...
Hi,
How can I check if a user enters a number in my UITextField. Basically its a mark im accepting between 0-100 and it can be a decimal....I heard i can try to convert it to a NSNumber type and see if it returns null.
Not suree Any help would be appreciated.
I have tried
if(grade.text doubleValue] == 0){
//Not a number
...
I am trying to set some text on a label
descriptionLabel.text = [NSString stringWithFormat:mySTUser.bio];
The bio property of mySTUser is an NSString. Sometimes it is not an NSString when I set it. How can I check if mySTUser.bio is an NSString so I can prevent it from being assigned to my label text?
...