This is part of an iPhone application but should apply to Cocoa written in objC in general.
I have a UILabel holding various amounts of text (from single characters to several sentences). The text should always be displayed in the largest possible font that fits all the text within the UILabel.
The maximum number of lines is set to 4 an...
My iOS app downloads document files from a server using the NSURLConnection class. I use it asynchronously.
It can happen that a document is missing from the server (configuration error). I expected NSURLConnection to call my delegate error method:
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
But...
Is there a way to implement custom Auto-completion for a UITextView, say by giving it a NSDictionary or NSArray of Strings to watch out for?
...
Is it common practice to do some kind of debouncing / refractory period for handling user touches?
I have a view based app with quite a few UI objects that are currently using touchUpInside to flip states. I notice that its almost easy to double touch or cycle the state more than once. Since the gameplay is relatively fast it doesn't ...
I put my avfoundation into frameworks by adding existing frameworks and importing it into my viewcontroller like this #import <AVFoundation/AVAudioPlayer.h>
I then called it in my IBAction so when a button pressed it, it plays like so.
-(IBAction)playSound{ //play the cricket noise
NSString *path = [[NSBundle mainBundle] pathForResour...
I have a simple app with two basic screens, a UIMapView and a UITableView. I'd like to have a toolbar at the bottom with a couple of buttons and a UISegmentedControl with two segments: "Map" and "Table". (The layout is similar to the Google Maps app that ships with the iPhone.) How can I keep the same toolbar while presenting either the ...
- (void)dealloc {
[super dealloc];
[receivedData release]; receivedData = nil;
}
or
- (void)dealloc {
[receivedData release]; receivedData = nil;
[super dealloc];
}
...
I have this code to play a sound but the first time you play it it takes a good 5 seconds to load...
How can I speed this up?
-(IBAction)playSound{ //play the cricket noise
NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"Cricket_Sound" ofType:@"mp3"];
audioPlayer =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fil...
Hi everyone,
I would like to have a text in a text... I mean like in the newspaper: when there is a picture, the text fits and follow the border of the picture.
For example: http://en.wikipedia.org/wiki/Iphone
look at the pictures... the text follows them!
Is it possible to do that on the iPhone?
Thanks in advance
...
I was wondering if there is any way to monitor 3rd party iphone applications' api calls? For instance if application access address book is there a way to monitor that or intercept call? I understand it may not be possible to do so without jail-breaking, but is even possibility after having jail broken the phone?
Thanks!
...
What is a good way to handle iOS 4 app termination when using an NSUndoManager?
I have an iPhone (iOS 4) application that uses Core Data. The app allows the user to edit managed objects, and I implement undo using NSUndoManager in a straightforward manner: Before displaying an editor view modally, I create a new NSUndoManager for the ma...
I have some view controllers:
StockTwitsTVViewController* stvViewController = [[[StockTwitsTVViewController alloc] initWithNibName:@"StockTwitsTVViewController" bundle:nil]autorelease];
UINavigationController *stvNavController = [[UINavigationController alloc] initWithRootViewController:stvViewController];
stvNavController.tabBa...
I want to display an image next to a UILabel, however UILabel has variable text length, so I don't know where to place the image. How can I accomplish this?
...
sizeWithFont crashed in multithread,this is the debug info:
1 0x00a0df8e in icu::RuleBasedBreakIterator::handleNext
2 0x00a0daff in icu::RuleBasedBreakIterator::next
3 0x00a0d174 in icu::RuleBasedBreakIterator::following
4 0x35879719 in WebCore::nextBreakablePosition
5 0x3587842a in -[NSString(WebStringDrawing) _web_drawInRect:withFont:...
Current I am trying to show a simple table in my iPhone application where I use UITableViewCell's with the style UITableViewCellStyleValue1 (image to the left, detail-label right-alligned). The cells all have the default height (50.0f). Before I add an image to the cell, I resize the image to be 40x40, so that it is not the total height ...
Hi,
I have a CALayer A with one sublayer B
I want A to be resized (to be shrank) so I add the animations to my layer A
but when I commit the animation sublayer B is not shrank. Its size remains(but its position changes as its superlayer bounds changes)
How can I make my B layer to be resized along with A animation?
This is what I wrote...
Is there a Objective-c function to return a NSString * from a NSUInteger, i.e.:
1 -> 1st
2 -> 2nd
...
10 -> 10th
21 -> 21st
...
31 -> 31st
for the range from 1 to 31. Thanks!
...
This is an example straight from Apple's documentation -
@implementation MyClass
- (id)initWithString:(NSString *)aName
{
self = [super init];
if (self) {
name = [aName copy];
}
return self;
}
+ (MyClass *)createMyClassWithString: (NSString *)aName
{
return [[[self alloc] initWithString:aName] autorelease];...
hey, I'm trying to make a accordion menu in Objective-C for a iPad app. The only thing I know is that I should look over core animation.
Couldn't find anything helpfull.
Can anyone help me ? at least give me a few pointers.
...
In the below code not invoked the willPresentAlertView method.
Why? The method is static? or The Alert value is static?
@interface ShowAlert : NSObject <UIAlertViewDelegate>
static UIAlertView* alert;
+(void) showAlert:(NSString*) msg{
alert = [[UIAlertView alloc] initWithTitle:nil message:[NSString stringWithFormat:...