Hi.
Not being able to find the answer, and also not being able to do what I want with
CGSize searchBarSize = self.searchDisplayController.searchBar.frame.size;
searchBarSize.width = ;
I ask: is there a way to change the width of a UISearchBar?
Tanks a lot.
How do you record an iPad screencast at full scale?
I have an iMac with maximum resolution 1680x1050 and the simulator doesn't fit the screen in portrait orientation. It does fit in landscape orientation.
Reducing the scale to 50% is not an option because the end result is too small. If the scale could be reduced slightly it would be fine, but not 50%.
Is it possible to put the simulator in landscape orientation and still keep the app in portrait mode? Then I could simply rotate the resulting video to get a portrait screencast.
I have root view with both tab bar and navigation bar visible at the beginning. When the view is moved to the next level, I would like to hide the tab bars, and when the view is moved back, I would like the tab bar visible. Is there any way to do that?
Hi guys, I keep on getting this error "error: expected specifier-qualifier-list for core data code im working with, in the app delegate.
Now when i get this error and about 40 other errors relating to managedobjectcontext etc, i thought maybe the library needs to be imported. Now i havent done this before, but i went to Frameworks group and add existing frameworks and it added CoreData.framework. I re-build and it still came up with the error. Do I need to import anything in the headers explicitly or is there some other step i need to do?
Thanks
hi .. i put a movie when my application will lunch . just like gameloft games .
so when application has lunched , movie plays fine but before the move plays .. my FirstViewController xib file show first then moview start to play ! why ?
here is my code :
- (void)applicationDidFinishLaunching:(UIApplication *)application {
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"movie" ofType:@"m4v"];
NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain];
MPMoviePlayerController *IntroMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
IntroMovie.movieControlMode = MPMovieControlModeHidden;
[IntroMovie play];
}
Hi,
I'm building a new (autorotating) iPad app that consists mainly of a screen sized UIScrollView that contains an UIImageView for an image which is 5 times the iPad screen resolution while in portrait mode (3840x1024).
What I haven't been able to accomplish is that whenever the device rotates (to whichever orientation) the imageView bounds and the scrollView contentSize asjusts the image for the new height (maintaining its aspect ratio), making the height of the image to always fit the device height for the given orientation (so in the particular case of this image, it would get shown as 2880x768).
I tried different combinations of autoresizingMask and contentMode for the imageView but the closer I've been able to get is to effectively display the image at the desired size but with a white padding around it and into the scrollView content (to make up for the original orientation contentSize). I also tried recalculating the scrollView contentSize in the didRotate.../viewWillAnimate... rotation-related methods in my viewController class, with no avail.
Best regards and thanks for your time
I want to be able to reorder cells in a table, but not to delete or insert them.
I want a picture like this:
This image appears in Apple's Table View Programming Guige, but the code samples there produce a table with red "delete" buttons when the table goes into editing mode.
I can set editingStyleForRowAtIndexPath to UITableViewCellEditingStyleNone and that makes the delete buttons go away, but the rows are still indented as if to make room for these buttons.
I want implement a layout in my ipad application that has a uitable view that scrolls left and right rather then up and down :
So rather than
row 1
row 2
row 3
( scrolling vertically )
It would be :
row 1, row2, row 3
(scrolling horizontally )
I've seen that UItableView is designed to only do vertical scrolling so doing a transform does not give the desired effect. Is there a standard way to do this taking advantage of a datasource provider like uitableview provides?
I basically want to do somthing similar to what the BBC News reader app ( http://itunes.apple.com/us/app/bbc-news/id364147881?mt=8 ) on the Ipad does with the list of stories to select from.
Thanks
OK, bear with me.
I have a UIView which is supposed to cover the whole device (UIWindow) to support an image zoom in/out effect I'm doing using core animation where a user taps a button on a UITableViewCell and I zoom the associated image.
The zooming is performing flawlessly, what I haven't been able to figure out is why the subview is still in portrait mode even though the device is in landscape. An illustration below:
http://www.weeshsoft.com/images/IMG_0482.jpg
I do have a navigation controller but this view has been added to the UIWindow directly.
Signed,
Baffled in Atlanta
Hi, I'm trying to create a single custom UITableViewCell from a xib, among other normal UITableViewCell's. I've tried quite a few varied things to no success. Can anyone help me please?
I'm trying to stream a video that is stored on Amazom S3 services.
I've tried passing the url with authentication using MPMoviePlayerController but with no success.
Like this: http://theusername:[email protected]/path/to/the/video
Have anyone done this before? I would like some advices, thanks.
Hi All,
I am downloading very large data from the server. I am using NSURLConnection class for getting the data.
How to implement the pause facility so that i can resume downloading where it was left ?
Thanks
Alright, so the key here is I'm not using IB at all, because the View I'm working with is created programmatically. The UIView covers the lower half the screen, and has a bunch of buttons on it. However, I want to add more buttons to the UIView, without making it any larger. To do so, I want to make a UIScrollView inside the view, which will allow me to add more buttons off screen so the user can scroll to them. I think that's how it works.
self.manaView = [[[UIView alloc] initWithFrame:frame] autorelease];
self.manaView.backgroundColor = [UIColor purpleColor];
UIScrollView *scroll = [UIScrollView alloc];
scroll.contentSize = CGSizeMake(320, 400);
scroll.showsHorizontalScrollIndicator = YES;
[self.manaView addSubview:scroll];
The first part of the code iniates my UIView, which works great, but I can't figure out how to make the UIScrollView programmatically and add it to the view, and then add the buttons to it.
UIButton *ret2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
ret2.tag = 102;
ret2.frame = CGRectMake(255, 5, 60, 50);
[ret2 setTitle:@"Return" forState:UIControlStateNormal];
[ret2 addTarget:self action:@selector(flipAction:) forControlEvents:UIControlEventTouchUpInside];
[scroll addSubview:ret2];
When I did that, the button simply disappeared off my screen. So How do I do this correctly? Thank you for your help!
Hi,
I am creating an application based on the Utility template. The main screen consists of a menu with several buttons, each of which creates a different flip-side view. In one of those flip-side views I also configured a Navigation Controller, which works perfectly as long as I have the NavigationBar activated... I can push the view but I have to use the "back" button to return to my flip-side view, which would be the root of the Navigation Controller. The problem comes if I try to go back using "popViewControllerAnimated", properly configured with a button, instead of the "back" button of the NavigationBar. My application crashes for some reason and I am not able to understand why.
I could just use the "back" button in the NavigationBar and forget about the problem, but I would prefer to have my own button in order to go back.
My app consists of the following:
My APPDelegate.m:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
MenuViewController *menuController = [[MenuViewController alloc] initWithNibName:@"MenuView" bundle:nil];
self.menuViewController = menuController;
[menuController release];
menuViewController.view.frame = [UIScreen mainScreen].applicationFrame;
[window addSubview:[menuViewController view]];
[window makeKeyAndVisible];
return YES;
}
MenuViewController.m starting my flip-side view:
- (IBAction)showFuelUpliftView {
FuelUpliftViewController *controller = [[FuelUpliftViewController alloc]
initWithNibName:@"FuelUpliftView" bundle:nil];
controller.delegate = self;
controller.title = @"Fuel Uplift";
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
[navController setNavigationBarHidden: NO];
navController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:navController animated:YES];
[navController release];
[controller release];
}
FuelUpliftViewController.m, where I push the second view of the NavigationController with a button:
- (IBAction)showFuelUplift2View:(id)sender {
UIViewController *controller = [[UIViewController alloc] initWithNibName:@"FuelUplift2View" bundle:nil];
controller.title = @"Settings";
[self.navigationController pushViewController:controller animated:YES];
[controller release];
}
And finally, my FuelUplift2ViewController.m, where the app crashes when trying to go back:
- (IBAction)backFromFuelUplift2View {
[self.navigationController popViewControllerAnimated:YES];
}
I do not know if all this makes sense, I am currently beginning with my first application and am still learning thanks to the traditional trial an error method. Nevertheless, I cannot see the reason for this problem and would appreciate any help I can get.
Thanks very much,
Manu
Here is the function where I get the compiler warning, I can't seem to figure out what is causing it. Any help is appreciated.
-(void)displaySelector{
//warning on the following line:
InstanceSelectorViewController *controller = [[InstanceSelectorViewController alloc] initWithCreator:self];
[self.navController pushViewController:controller animated:YES];
[controller release];
}
Interface and implementation for the initWithCreator: method
-(InstanceSelectorViewController*)initWithCreator:(InstanceCreator*)creator;
-(InstanceSelectorViewController*)initWithCreator:(InstanceCreator*)crt{
if (self = [self initWithNibName:@"InstanceSelectorViewController" bundle:nil]) {
creator = crt;
}
return self;
}
I have a button in a custom UITableViewCell. Its UITableView is controlled by a UIViewController. I would like to return to the RootView when that button is clicked.
I am trying to use
[self.superview.navigationController popViewControllerAnimated:YES];
in the target Action of the button, which is in the UITableViewCell.m file. However, it doesn't recognize "navigationController" because it is not in the stack.
How can I return to the RootView when that button is clicked?
Hello
Currently I have an entity named "Events" in a CoreData app. "Events" has one string property named "eventName".
In the -(void)viewDidLoad I am trying to Fetch all the "Events" objects and load their "eventName" by alphabetical order into a UIPickerView.
The ultimate end goal is through the use of a textField, buttons and the pickerView being add new objects in and remove unwanted objects out. Basically turning the UIPickerView into a UITableView. Currently I am able to save objects to the CoreData store, but am not able to pull them/their properties out into the UIPickerView.
I am willing and able to share the project source code to anyone who wants it, or is willing to look at it to help out.
thanks
Chris
Sorry if this has been asked before, but I'm wondering what the best memory management practice is for NSURLConnection. Apple's sample code uses -[NSURLConnection initWithRequest:delegate:] in one method and then releases in connection:didFailWithError: or connectionDidFinishLoading:, but this spits out a bunch of analyzer warnings and seems sort of dangerous (what if neither of those methods is called?).
I've been autoreleasing (using +[NSURLConnection connectionWithRequest:delegate:]), which seems cleaner, but I'm wondering--in this case, is it at ever possible for the NSURLConnection to be released before the connection has closed?
Hi there,
I aint sure if this is the right place to ask or report this... but i hope someone here can help me out with the following problem
I'm currently creating an app which offers several functionalities. anyways it also includes the TTPhotoViewController which Three20 offers. Well this controller is absolutely awesome but i'm haveing some trouble after useing the TTPhotoviewcontorller, since then all content falls behind my navigationbarcontroller.
Here are some screenshots where you can see before and after opening the viewcontroller
Before : http:// img121.imageshack.us/img121/2253/fotoze.jpg
After : http:// img88.imageshack.us/img88/5899/foto1c.jpg
[remove spaces after the // ]
Hopefully you guys can help me out since i'm quite new in these things.
Thanks in advance,
Wesley
From picture i try to update UILabel at cell that i press but it update incorrect row
how can i update text correct row?
mycode when add To accessoryView it will reuse to create each row
self.info = [[UILabel alloc] initWithFrame:CGRectMake((accView.image.size.width/2.5), 0.0, accView.image.size.width/2, accView.image.size.height)];
self.info.text = @"RSS";
self.info.tag = 3;
self.info.textColor = [UIColor whiteColor];
self.info.shadowColor = [UIColor blackColor];
self.info.shadowOffset = CGSizeMake(1,1);
self.info.font = [UIFont boldSystemFontOfSize:11];
self.info.backgroundColor = [UIColor clearColor];
[cell.accessoryView addSubview:self.info];
When converting PDF Pages into UIImages I receive memory warnings all the time.
It seems there is either some leak or something else that eats my memory.
Using instruments didn't give me any helpful details.
I'm using the following function to generate images from a pdf file:
- (UIImage*)pdfImage:(NSString*)pdfFilename page:(int)page {
CFURLRef pdfURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)pdfFilename, kCFURLPOSIXPathStyle, false);
CGPDFDocumentRef pdfRef = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);
CFRelease(pdfURL);
CGPDFPageRef pdfPage = CGPDFDocumentGetPage(pdfRef, page);
CGRect pdfPageSize = CGPDFPageGetBoxRect(pdfPage, kCGPDFBleedBox);
float pdfScale;
if ( pdfPageSize.size.width < pdfPageSize.size.height ) {
pdfScale = PDF_MIN_SIZE / pdfPageSize.size.width;
}
else {
pdfScale = PDF_MIN_SIZE / pdfPageSize.size.height;
}
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(NULL,
pdfPageSize.size.width*pdfScale,
pdfPageSize.size.height*pdfScale,
8,
(int)pdfPageSize.size.width*pdfScale * 4,
colorSpace,
kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
CGColorSpaceRelease(colorSpace);
// CGContextClipToRect(context, pdfPageView.frame);
// CGPDFPageRetain(pdfPage);
CGAffineTransform transform = aspectFit(CGPDFPageGetBoxRect(pdfPage, kCGPDFBleedBox),
CGContextGetClipBoundingBox(context));
CGContextConcatCTM(context, transform);
CGContextDrawPDFPage(context, pdfPage);
// CGPDFPageRelease (pdfPage);
CGImageRef image = CGBitmapContextCreateImage(context);
CGContextRelease(context);
UIImage *finalImage = [UIImage imageWithCGImage:image];
CGImageRelease(image);
CGPDFDocumentRelease(pdfRef);
return finalImage;
}
I am releasing the document and everything else, so where could be the problem?
Thanks for your help!
Hi!
I'm having a problem with UIViewAnimationTransitionCurlUp and landscape mode.
In my landscape application I have a view controller that manages two fullscreen views. In the controller I have a container view for the transitions. To switch between the two views, I use a curled transition but the animation is performed as if it were in portrait mode.
I have setted the UIDeviceOrientation in info.plist, also the supported orientations to both landscape right and left. The controller returns true in shouldAutorotateToInterfaceOrientation only for landscape right and left. I have also tried to start the controller and views with 480 width and 320 height manually. I dont know where is the problema and dont know what else to try.
Could someone help me?
Thank you!
I am having a problem setting the background of UITableView to a UIImageView (see below for why I am doing this), once the view is set, it works fine, and scrolls with the UITableView, but it hides the elements of the Table View.
I need to have a UIImageView as the background for a UITableView. I know this has been answered before, but the answers are to use:
[UIColor colorWithPatternImage:[UIImage imageNamed:@"myImage.png"]];
Or something like (which I need to use):
UIImageView *background = [MainWindow generateBackgroundWithFrame:tableView.bounds];
[tableView addSubview:background];
[tableView sendSubviewToBack:background];
The reason I need to use the latter is because of my generateBackgroundWithFrame method, which takes a large image, and draws a border around that image to the dimensions specified, and clips the remainder of the image:
+ (UIImageView *) generateBackgroundWithFrame: (CGRect)frame {
UIImageView *background = [[[UIImageView alloc] initWithFrame:frame] autorelease];
background.image = [UIImage imageNamed:@"globalBackground.png"];
[background.layer setMasksToBounds:YES];
[background.layer setCornerRadius:10.0];
[background.layer setBorderColor:[[UIColor grayColor] CGColor]];
[background.layer setBorderWidth:3.0];
return background;
}
Please note: I understand that this might poorly effect performance, but I don't have the resources to go through and make those images for each potential screen in the app. Please do not answer this question with a mindless "you shouldn't do this" response. I am aware that it is possibly the wrong thing to do.
How do I show my UITableView control elements? Is there something that I am doing wrong in my delegate? Here is a simplified version:
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell =
[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc]
initWithFrame:CGRectMake(20, 20, 261, 45)
reuseIdentifier:CellIdentifier] autorelease];
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
UIImage *rowBackground;
NSString *imageName = @"standAloneTVButton.png";
rowBackground = [UIImage imageNamed:imageName];
UITextView *textView =
[[UITextView alloc] initWithFrame:CGRectMake(0, 5, 300, 200)];
textView.backgroundColor = [UIColor clearColor];
textView.textColor = [UIColor blackColor];
textView.font = [UIFont fontWithName:@"Helvetica" size:18.0f];
Purchase *purchase =
[[PurchaseModel productsPurchased] objectAtIndex:indexPath.row];
textView.text = [purchase Title];
selectedTextView.text = textView.text;
UIImageView *normalBackground =
[[[UIImageView alloc] init] autorelease];
normalBackground.image = rowBackground;
[normalBackground insertSubview:textView atIndex:0];
cell.backgroundView = normalBackground;
[textView release];
}
return cell;
}
hey there,
I've got an app that records audio. I'm wondering how I can increase the gain. is there a way to normalize the audio or amplify it somehow?
thanks,
howie