I have a UIModalPresentationFullScreen but my UI elements are not showing up properly. I want to define the screensize in IB, but I'm not sure what the size should be?
I have a NIB that contains a UINavigationController which has a UIViewController. The UIViewController is being loaded externally from another nib. I am unable to set the view property thus I get the error:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "LBRootViewController" nib but the view outlet was not set.'
How can I set my view property correctly?
I have a blackberry app that I am trying to deploy OTA (over the air).
I have set the MIME type on my server to be:
cod application/vnd.rim.cod
jad text/vnd.sun.j2me.app-descriptor
jar application/java-archive
When I access the JAD file on my web-server through the BlackBerry Browser, I get the message
Unsupported Media Type
and then a prompt to download the JAD. How can I resolve this?
I have a modal view that is presented and dismissed fine when my device is in vertical orientation. I have problems when my modal view is presented in the vertical orientation, but dismissed in horizontal orientation. The entire app switches back to vertical orientation automatically. How can I ensure that if I am in horizontal orientation, the view should dismiss properly?
I am trying to do something interesting.
I am pulling some JSON data and populating cells in a UITableView. How can I make the UITableView scroll ever second or so? I want to give the effect that as new data is coming in, the table is scrolling, so it is streaming.
Any ideas?
Lets say I have an array X that contains [A,B,C,D,nil];
and I have a second array Y that contains [E,F,G,H,I,J,nil];
If I execute the following:
//Append y to x
[x addObjectsFromArray:y];
//Empty y and copy x
[y removeAllObjects];
y = [x mutableCopy];
What is the value of y? is it?:
[A,B,C,D,E,F,G,H,I,J,nil]
Am I performing the copy correctly?
Let's assume I can have the following strings:
"hey @john..."
"@john, hello"
"@john(hello)"
I am tokenizing the string to get every word separated by a space:
[myString componentsSeparatedByString:@" "];
My array of tokens now contain:
@john...
@john,
@john(hello)
For these cases. How can I make sure only @john is tokenized, while retaining the trailing characters:
...
,
(hello)
Note: I would like to be able to handle all cases of characters at the end of a string. The above are just 3 examples.
Is there a good UITabBarController example where it is NOT created in the appDelegate?
I would like to use a UITabBarController inside of a UIViewController, however dont know how to set the view outlet.
I have two NIB's
ParentViewController.xib
ChildViewController.xib
ParentViewController.xib contains a UIView and a UIViewController.
ChildViewController.xib contains a UIButton
I want ChildViewController.xib to load in the ParentViewController.xib's UIView
I have done the following:
Created @property for UIView in ParentViewController
Connected File's Owner to UIView in ParentViewController
Set UIViewController in ParentViewController's NIB Name property to ChildViewController in Interface Builder
Set ChildViewController view property to UIView in ParentViewController
I was hoping this would load ChildViewController into my UIView in ParentViewController but no luck.
I did get the following warning, which could be the culprit:
'View Controller (Child View)' has both its 'NIB Name' property set and its 'view' outlet connected. This configuration is not supported.
I also have added additional code in ParentViewController's viewDidLoad():
- (void)viewDidLoad {
[super viewDidLoad];
ChildViewController *childViewController = [[ChildViewController alloc]initWithNibName:@"ChildViewController" bundle:nil];
childViewController.view = self.myView;
}
Any thoughts on why ChildViewController does not load in the UIView of ParentViewController?
I have enabled NSZombie's and I am getting the following message in my console when I am running my application:
*** -[UIViewAnimationState release]: message sent to deallocated instance 0xf96d7e0
Here is the method that is performing the animation
-(void)loadAvatar:(STObject*)st
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
avatar.alpha = 0;
avatar.frame = avatarRectSmall;
avatar.image = [ImageCache getMemoryCachedImageAtUrl:st.avatar_url];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.50];
avatar.frame = avatarRectNormal;
[avatar setAlpha:1];
[UIView commitAnimations];
[pool release];
pool = nil;
}
I don't always get a crash, only sometimes. I'm wondering what is getting released?
I have two NSMutableArrays:
NSMutableArray* currentMessages
NSMutableArray* items
I am trying to copy the contents of items into currentMessages as such:
[self.currentMessages addObjectsFromArray:self.items];
When I am debugging self.items contains 30 objects. After this operation self.currentMessages contains 0 objects.
Why is the copy not working?
I have a UITableViewCell that has some labels and images that can be clicked. I want to present a popover whenever a user clicks on any part of the cell. How can I achieve this without interfering with the click actions of the labels & images?
I am currently creating an invisible button ontop of some other clickable items in the cell and calling the popover:
[replyPopover presentPopoverFromRect:CGRectMake(77, 25, 408, 68) inView:self permittedArrowDirections: UIPopoverArrowDirectionDown animated:YES];
Unfortunately, because the button is on top of the labels & images I am unable to click them.
How can I show a popover by clicking on the background of a cell, so that there is no interference when clicking images & labels inside the cell?
I am displaying a UITableViewController inside of a UITabBarController that is being presented modally:
-(IBAction)arButtonClicked:(id)sender{
//this is a uitableviewcontroller
ARViewController* arViewController = [[[ARViewController alloc] initWithNibName:@"ARViewController" bundle:nil]autorelease];
LeaderBoardTableViewController* lbViewController = [[[LeaderBoardTableViewController alloc] initWithNibName:@"LeaderBoardTableViewController" bundle:nil]autorelease];
lbViewController.title = @"Leaderboard";
arTabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
arTabBarController.viewControllers = [NSArray arrayWithObjects:arViewController, lbViewController, nil];
arTabBarController.selectedViewController = arViewController;
[self presentModalViewController:arTabBarController animated:YES];
}
In my viewDidLoad for arViewController method I am setting the navigation items:
- (void)viewDidLoad {
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
self.clearsSelectionOnViewWillAppear = NO;
self.title = @"AR";
leaderBoardButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemOrganize
target:self
action:@selector(leaderBoardButtonClicked:)];
self.navigationItem.rightBarButtonItem = leaderBoardButton;
}
My navigation bar doesn't appear when it is inside of the UITabBarController, but when I push the view itself I am able to see it.
What am I missing?
I have a very simple UITableView that has 3 sections, and 3 rows per section.
#pragma mark -
#pragma mark UITableView delegate methods
- (NSInteger)tableView:(UITableView *)tblView numberOfRowsInSection:(NSInteger)section
{
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tblView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tblView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
return cell;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tblView
{
if (tblView == self.tableView) {
return 3;
}
else {
return 1;
}
}
Everything shows up fine, but as soon as I scroll my application crashes and my debugger tells me:
* -[ProfileViewController tableView:cellForRowAtIndexPath:]: message sent to deallocated instance 0x5ae61b0
I'm not exactly sure what I am doing wrong.
I have a Blackberry app on my web-server. When a user downloads via the BlackBerry Browser the JAD file is installed automatically, but does not appear in the Downloads folder or in the installed Applications folder. Did I do something wrong with my deployment?
I have a UIViewController that contains a UITabbarController which contains a UINavigationController.
When I am setting up my IB outlets, what should the File's Owner view outlet be set to?
My app has a UITabBarController that loads many different UINavigationControllers. I want a UIPageControl to switch between the different UINavigationControllers. Do I place the UIPageControl in my UINavigationController or in my appDelegate? Suggestions and best practices are welcome.
I have a grouped UITableView with a few sections. The text in some of the cells can get quite long, I was wondering how I could make the text word-wrap?
For some reason I get linker errors when I try and use CALayer:
"_OBJC_CLASS_$_CALayer", referenced from:
I have imported the following headers:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
Code:
arrowImage = [[CALayer alloc] init];
I have a NIB that contains a UIView.
I have another NIB that contains a UITableView.
How can I load the UITableView NIB inside of the UIView in my other NIB?
I am trying to stream a video using MPMoviePlayerController but only audio is working. How can I get the video to appear?
- (void)loadView {
NSString *url = @"http://d1xt8xjto3lfs9.cloudfront.net/060810/afternoonupdate060810.mov";
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:url]];
[moviePlayer play];
}
I have a UITableView which I would like to be displayed 100px down. For some reason this only works when animated is set to YES. Why is this?
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
/*[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]
atScrollPosition:UITableViewScrollPositionNone
animated:NO];*/
/*[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathWithIndex:1]
atScrollPosition:UITableViewScrollPositionNone
animated:NO];*/
[self.tableView setContentOffset:CGPointMake(0,100) animated:YES];
}
I have a very basic data class that is subclassed from NSObject. I declare a few strings, make sure they have properties (nonatomic, copy), and synthesize them. The only method I implemented was dealloc() which releases my strings. Can any memory problems arise from just this? Are there any other methods I need to implement?