objective-c

How do runtime-created sub views communicate with the view controller?

Hi In my iPhone project I have a UIViewController in which I add an instance of a subclass of UIView. From this instance I need to communicate back an integer to my view controller. My current solution is to send a message from my instance to my App Delegate which sends a message to the view controller. It works, but it feels a bit mess...

Difference between import in java and objective C

can some tell me the difference between the import we use in java and the one in objective C? ...

How to play video in portrait mode in iphone

hi to all, I am creating a movie appliction in iphone/ipod .i have added a video to it . when i run it in simulator it runs properly in portrait mode.But when i run my app in ipod it opens a blank video and in landscape mode .but in simulator when i click on play my video directly plays in portrait mode and in ipod it opens a blank vide...

NTLM authentication using iPhone / iPad

Hi, I am trying to develop an iPad application for enterprise deployment. The application needs to access some of the data whose access is currently controlled by NTLM authentication. I am looking at options to authenticate the user from the native application and access the rest of the system. Anybody pointers will be helpful. ...

ABUnknownPersonViewController problem - adding data to existing contact

Hi, I'm having a problem with the ABUnknownPersonViewController. I want the user to be able to save or edit a contact to the address book. All is fine when "Add contact" is used. But when the user wants to add data to an existing contact I run into problems. The ABUnknownPersonViewController displays a PeoplePicker but when the user sel...

iOS / Core Data: How to create a predicate for words that start with a range of characters?

The 'Like' is pretty simple it seems, it only supports ? and * I believe, kind of like old-school wildcards. But I want to do this: Find all words that begin with a given range of characters... for example a-j. So I got it to find all words that start with say, the letter j: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"...

Finger drag on your bottoms

Hello all, assume that a five buttons side by side, i need to know how to make them accept (Called) the drag from outside to inside the border of each button i.e. Like the piano if u drag your finger every button called and make sound Thanks ...

UIMenuController with a set of colored button

I have a requirement - in an application i'm currently developing - to show a list of colors upon clicking on a button so the user can select a single color out of the list. I strongly believe the best way to this would be to have a UIMenuController popup - just like you'd see the copy/cut/paste menu in iphone - and show the list of colo...

LibXML doesn't find any nodes for my xpath expression

Hello! I'm using xpath and LibXML in an iPhone app to find some nodes in an xml document. I'm a noob in xpath so probably i am doing something wrong. Here is the xml: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs...

UISwipeGestureRecognizer gesture start point.

Is it possible to get a gesture start point from a UISwipeGestureRecognizer. like how its possible in - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch * touch = [touches anyObject]; gestureStartPoint = [touch locationInView:self]; } ...

How can I reverse the byte order of an NSInteger or NSUInteger in objective-c

This is a somewhat of a follow up to this posting (http://stackoverflow.com/questions/2718712/how-to-convert-byte-value-into-int-in-objective-c) but with a different question so I felt I should ask in a separate thread. I am at the point where I have four consecutive bytes in memory that I have read in from a file. I'd like to store ...

Cross-fade within AVMutableVideoComposition

I have successfully composed an AVMutableComposition with multiple video clips and can view it and export it, and I would like to be able to transition between them using a cross-fade, so I want to use AVMutableVideoComposition. I can't find any examples on how to even arrange and play a couple AVAsset videos in succession. Does anyone...

why does it works fine without 'retain' the object?

Here i used auto-release for 'tempString' in the method 'test'. According to the rule, i should use "[temp retain]" in the main . But i didnt use it. still it works fine and prints the output. Then what is the need of "retain"? Can anyone pls tell me the reason? Thanks in advance. -(NSMutableString *) test : (NSMutableString *) aString...

Is there a way to get NSXMLParser to ignore the "&amp" and similar symbols while parsing XML?

I'm currently parsing an xml file that has a string like this between two elements: Hello & bye When the foundCharacters delegate gets called it parses the information like this.... it parses: Hello & bye It makes 3 calls to parse that element and I end up with 3 strings as opposed to 1 string. Is there some way to detect this wit...

How do I animate adding subviews?

How do I animate adding sub views to a view? I know it animates when you use a navigation controller however is it possible to animate around this code: [self.view addSubview:myVC.view]; ...

How do I find the plain version of a font in Core Text?

I'm using 'CTFontCreateCopyWithSymbolicTraits' to create a 'CTFontRef' with an italic version ('kCTFontItalicTrait'). Is there a way of taking the same italic font and using 'CTFontCreateCopyWithSymbolicTraits' to set it back to the plain version again? Thanks! ...

Volume Control for entire app

My current app could probably be thought of as a sound board. There are a few buttons to click on which produce sounds. The sound are on on View Controller. Nested inside that is another View Controller with the settings which will pop up when called. This is where I need to put my volume slider. To produce the sounds the parent View...

AudioUnit: access ComponentKernel properties from CocoaView

Hi, I would like to access my AudioUnit Component Kernel members from an action method defined in the cocoa view of my AudioUnit Component : - (IBAction)iaParam1Changed:(id)sender { float floatValue = [sender floatValue]; NSAssert(AUParameterSet(mParameterListener, sender, &mParameter[0], (Float32)floatValue, 0) == noErr, @"[MyA...

Trying to make a card from CALayers that can flip over

I've been trying to develop a CALayer based "CardView" object that has two layers that face away from each other to present the two sides of a card. I've been working with things like the doublesided property of the CALayer and find the results to be confusing. My base class is CALayer and I'm adding two sublayers to it, one with a M_P...

Objective c NSDate taking off 1 hour from parsed date

Hello I am parsing the following string format: "29/09/2010 12:45:00" with the following code: NSDateFormatter *df = [[NSDateFormatter alloc] init]; [df setDateFormat:@"dd/MM/yyyy HH:mm:ss"]; NSDate *dateTime = [[df dateFromString:dateAndTime]]; But the NSDate object then contains the following: 2010/09/29 11:45:00 Does anyone have ...