iphone Programming Glossary: initwithframe
How to intercept touches events on a MKMapView or UIWebView objects? http://stackoverflow.com/questions/1049889/how-to-intercept-touches-events-on-a-mkmapview-or-uiwebview-objects I use this class I see nothing on the Console MapViewWithTouches mapView MapViewWithTouches alloc initWithFrame self.view.frame self.view insertSubview mapView atIndex 0 Any idea what I'm doing wrong iphone objective..
Placeholder in UITextView http://stackoverflow.com/questions/1328638/placeholder-in-uitextview self selector @selector textChanged name UITextViewTextDidChangeNotification object nil id initWithFrame CGRect frame if self super initWithFrame frame self setPlaceholder @ self setPlaceholderColor UIColor.. name UITextViewTextDidChangeNotification object nil id initWithFrame CGRect frame if self super initWithFrame frame self setPlaceholder @ self setPlaceholderColor UIColor lightGrayColor NSNotificationCenter defaultCenter.. rect if self placeholder length 0 if _placeHolderLabel nil _placeHolderLabel UILabel alloc initWithFrame CGRectMake 8 8 self.bounds.size.width 16 0 _placeHolderLabel.lineBreakMode NSLineBreakByWordWrapping..
Detecting which UIButton was pressed in a UITableView http://stackoverflow.com/questions/1802707/detecting-which-uibutton-was-pressed-in-a-uitableview reuseIdentifier identifier cell autorelelase UIButton button UIButton alloc initWithFrame CGRectMake 10 5 40 20 button addTarget self action @selector buttonPressedAction forControlEvents UIControlEventTouchUpInside.. reuseIdentifier identifier cell autorelelase UIButton button UIButton alloc initWithFrame CGRectMake 10 5 40 20 button addTarget self action @selector buttonPressedAction forControlEvents UIControlEventTouchUpInside..
Rounded UIView using CALayers - only some corners - How? http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how add this void viewDidLoad CGRect rect CGRectMake 10 10 200 100 MyView myView MyView alloc initWithFrame rect self.view addSubview myView super viewDidLoad MyView is just a UIImageView subclass @interface..
Adding view on StatusBar in iPhone http://stackoverflow.com/questions/2833724/adding-view-on-statusbar-in-iphone the existing status bar. Just create a simple subclass of UIWindow with the following override of initWithFrame @interface ACStatusBarOverlayWindow UIWindow @end @implementation ACStatusBarOverlayWindow id initWithFrame.. @interface ACStatusBarOverlayWindow UIWindow @end @implementation ACStatusBarOverlayWindow id initWithFrame CGRect frame if self super initWithFrame frame Place the window on the correct level and position self.windowLevel.. UIWindow @end @implementation ACStatusBarOverlayWindow id initWithFrame CGRect frame if self super initWithFrame frame Place the window on the correct level and position self.windowLevel UIWindowLevelStatusBar 1.0f..
How to customize the background/border colors of a grouped table view cell? http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell CustomCellBackgroundView @synthesize borderColor fillColor position BOOL isOpaque return NO id initWithFrame CGRect frame if self super initWithFrame frame Initialization code return self void drawRect CGRect.. borderColor fillColor position BOOL isOpaque return NO id initWithFrame CGRect frame if self super initWithFrame frame Initialization code return self void drawRect CGRect rect Drawing code CGContextRef c UIGraphicsGetCurrentContext..
How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar http://stackoverflow.com/questions/4471289/how-to-filter-nsfetchedresultscontroller-coredata-with-uisearchdisplaycontroll Other view information void loadView super loadView UISearchBar searchBar UISearchBar alloc initWithFrame CGRectMake 0 0 self.tableView.frame.size.width 44.0 autorelease searchBar.autoresizingMask UIViewAutoresizingFlexibleWidth..
Changing Tint / Background color of UITabBar http://stackoverflow.com/questions/571028/changing-tint-background-color-of-uitabbar viewDidLoad CGRect frame CGRectMake 0.0 0.0 self.view.bounds.size.width 48 UIView v UIView alloc initWithFrame frame v setBackgroundColor kMainColor v setAlpha 0.5 self tabBar addSubview v v release @end share..
How to change UIPickerView height http://stackoverflow.com/questions/573979/how-to-change-uipickerview-height control and passing a desired frame size at creation time e.g smallerPicker UIPickerView alloc initWithFrame CGRectMake 0.0 0.0 320.0 120.0 You will discover that at various heights and widths there are visual..
Locking the Fields in MFMailComposeViewController http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller fade the overlay in loadingLabel @ Sending Test Drive... bgimage UIImageView alloc initWithFrame CGRectMake 0 0 320 480 bgimage.image UIImage imageNamed @ waitOverLay.png self.view addSubview bgimage..
Custom colors in UITabBar http://stackoverflow.com/questions/675433/custom-colors-in-uitabbar viewDidLoad CGRect frame CGRectMake 0.0 0 self.view.bounds.size.width 48 UIView v UIView alloc initWithFrame frame v setBackgroundColor UIColor alloc initWithRed 1.0 green 0.0 blue 0.0 alpha 0.1 tabBar1..
iCloud basics and code sample [closed] http://stackoverflow.com/questions/7795629/icloud-basics-and-code-sample NSDictionary launchOptions NSLog @ AppDelegate app did finish launching self.window UIWindow alloc initWithFrame UIScreen mainScreen bounds autorelease Override point for customization after application launch. if..
Animate change of view controllers without using navigation controller stack, subviews or modal controllers? http://stackoverflow.com/questions/8146253/animate-change-of-view-controllers-without-using-navigation-controller-stack-su application didFinishLaunchingWithOptions NSDictionary launchOptions self.window UIWindow alloc initWithFrame UIScreen mainScreen bounds MyViewController vc MyViewContoller alloc init... self.transitionController..
Transparent Modal View on Navigation Controller http://stackoverflow.com/questions/849458/transparent-modal-view-on-navigation-controller . You can add the modal view directly to the view hierarchy like so UIView modalView UIView alloc initWithFrame UIScreen mainScreen bounds autorelease modalView.opaque NO modalView.backgroundColor UIColor blackColor..
How to intercept touches events on a MKMapView or UIWebView objects? http://stackoverflow.com/questions/1049889/how-to-intercept-touches-events-on-a-mkmapview-or-uiwebview-objects touches withEvent event @end But it looks like when I use this class I see nothing on the Console MapViewWithTouches mapView MapViewWithTouches alloc initWithFrame self.view.frame self.view insertSubview mapView atIndex 0 Any idea what I'm doing wrong iphone objective c iphone sdk 3.0 share improve this question None..
Placeholder in UITextView http://stackoverflow.com/questions/1328638/placeholder-in-uitextview lightGrayColor NSNotificationCenter defaultCenter addObserver self selector @selector textChanged name UITextViewTextDidChangeNotification object nil id initWithFrame CGRect frame if self super initWithFrame frame self setPlaceholder @ self setPlaceholderColor UIColor lightGrayColor NSNotificationCenter defaultCenter addObserver.. defaultCenter addObserver self selector @selector textChanged name UITextViewTextDidChangeNotification object nil id initWithFrame CGRect frame if self super initWithFrame frame self setPlaceholder @ self setPlaceholderColor UIColor lightGrayColor NSNotificationCenter defaultCenter addObserver self selector @selector textChanged.. text super setText text self textChanged nil void drawRect CGRect rect if self placeholder length 0 if _placeHolderLabel nil _placeHolderLabel UILabel alloc initWithFrame CGRectMake 8 8 self.bounds.size.width 16 0 _placeHolderLabel.lineBreakMode NSLineBreakByWordWrapping _placeHolderLabel.numberOfLines 0 _placeHolderLabel.font self.font..
Detecting which UIButton was pressed in a UITableView http://stackoverflow.com/questions/1802707/detecting-which-uibutton-was-pressed-in-a-uitableview if cell nil cell UITableView alloc initWithStyle UITableViewCellStyleDefault reuseIdentifier identifier cell autorelelase UIButton button UIButton alloc initWithFrame CGRectMake 10 5 40 20 button addTarget self action @selector buttonPressedAction forControlEvents UIControlEventTouchUpInside button setTag 1 cell.contentView addSubview.. if cell nil cell UITableView alloc initWithStyle UITableViewCellStyleDefault reuseIdentifier identifier cell autorelelase UIButton button UIButton alloc initWithFrame CGRectMake 10 5 40 20 button addTarget self action @selector buttonPressedAction forControlEvents UIControlEventTouchUpInside cell.contentView addSubview button..
Rounded UIView using CALayers - only some corners - How? http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how an iPhone project with the View template. In the view controller add this void viewDidLoad CGRect rect CGRectMake 10 10 200 100 MyView myView MyView alloc initWithFrame rect self.view addSubview myView super viewDidLoad MyView is just a UIImageView subclass @interface MyView UIImageView I'd never used graphics contexts before but..
Adding view on StatusBar in iPhone http://stackoverflow.com/questions/2833724/adding-view-on-statusbar-in-iphone can easily accomplish this by creating your own window above the existing status bar. Just create a simple subclass of UIWindow with the following override of initWithFrame @interface ACStatusBarOverlayWindow UIWindow @end @implementation ACStatusBarOverlayWindow id initWithFrame CGRect frame if self super initWithFrame frame Place.. of UIWindow with the following override of initWithFrame @interface ACStatusBarOverlayWindow UIWindow @end @implementation ACStatusBarOverlayWindow id initWithFrame CGRect frame if self super initWithFrame frame Place the window on the correct level and position self.windowLevel UIWindowLevelStatusBar 1.0f self.frame UIApplication.. of initWithFrame @interface ACStatusBarOverlayWindow UIWindow @end @implementation ACStatusBarOverlayWindow id initWithFrame CGRect frame if self super initWithFrame frame Place the window on the correct level and position self.windowLevel UIWindowLevelStatusBar 1.0f self.frame UIApplication sharedApplication statusBarFrame..
How to customize the background/border colors of a grouped table view cell? http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell CGRect rect float ovalWidth float ovalHeight @implementation CustomCellBackgroundView @synthesize borderColor fillColor position BOOL isOpaque return NO id initWithFrame CGRect frame if self super initWithFrame frame Initialization code return self void drawRect CGRect rect Drawing code CGContextRef c UIGraphicsGetCurrentContext.. @implementation CustomCellBackgroundView @synthesize borderColor fillColor position BOOL isOpaque return NO id initWithFrame CGRect frame if self super initWithFrame frame Initialization code return self void drawRect CGRect rect Drawing code CGContextRef c UIGraphicsGetCurrentContext CGContextSetFillColorWithColor c fillColor..
How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar http://stackoverflow.com/questions/4471289/how-to-filter-nsfetchedresultscontroller-coredata-with-uisearchdisplaycontroll tableView endUpdates Other view information void loadView super loadView UISearchBar searchBar UISearchBar alloc initWithFrame CGRectMake 0 0 self.tableView.frame.size.width 44.0 autorelease searchBar.autoresizingMask UIViewAutoresizingFlexibleWidth searchBar.autocorrectionType UITextAutocorrectionTypeNo..
Changing Tint / Background color of UITabBar http://stackoverflow.com/questions/571028/changing-tint-background-color-of-uitabbar
How to change UIPickerView height http://stackoverflow.com/questions/573979/how-to-change-uipickerview-height achieve a change in the height of the view by taking complete control and passing a desired frame size at creation time e.g smallerPicker UIPickerView alloc initWithFrame CGRectMake 0.0 0.0 320.0 120.0 You will discover that at various heights and widths there are visual glitches. Obviously these glitches would either need to be..
Locking the Fields in MFMailComposeViewController http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller @ OK otherButtonTitles nil alert show alert release void createWaitOverlay fade the overlay in loadingLabel @ Sending Test Drive... bgimage UIImageView alloc initWithFrame CGRectMake 0 0 320 480 bgimage.image UIImage imageNamed @ waitOverLay.png self.view addSubview bgimage bgimage.alpha 0 bgimage addSubview loadingLabel loadingLabel.alpha..
Custom colors in UITabBar http://stackoverflow.com/questions/675433/custom-colors-in-uitabbar @synthesize tabBar1 void viewDidLoad super viewDidLoad CGRect frame CGRectMake 0.0 0 self.view.bounds.size.width 48 UIView v UIView alloc initWithFrame frame v setBackgroundColor UIColor alloc initWithRed 1.0 green 0.0 blue 0.0 alpha 0.1 tabBar1 insertSubview v atIndex 0 v release @end And in your Nib..
iCloud basics and code sample [closed] http://stackoverflow.com/questions/7795629/icloud-basics-and-code-sample UIApplication application didFinishLaunchingWithOptions NSDictionary launchOptions NSLog @ AppDelegate app did finish launching self.window UIWindow alloc initWithFrame UIScreen mainScreen bounds autorelease Override point for customization after application launch. if UIDevice currentDevice userInterfaceIdiom UIUserInterfaceIdiomPhone..
Animate change of view controllers without using navigation controller stack, subviews or modal controllers? http://stackoverflow.com/questions/8146253/animate-change-of-view-controllers-without-using-navigation-controller-stack-su for the TransitionController BOOL application UIApplication application didFinishLaunchingWithOptions NSDictionary launchOptions self.window UIWindow alloc initWithFrame UIScreen mainScreen bounds MyViewController vc MyViewContoller alloc init... self.transitionController TransitionController alloc initWithViewController vc self.window.rootViewController..
Transparent Modal View on Navigation Controller http://stackoverflow.com/questions/849458/transparent-modal-view-on-navigation-controller and viewDidDisappear methods in your root view controller . You can add the modal view directly to the view hierarchy like so UIView modalView UIView alloc initWithFrame UIScreen mainScreen bounds autorelease modalView.opaque NO modalView.backgroundColor UIColor blackColor colorWithAlphaComponent 0.5f UILabel label UILabel alloc..
How to intercept touches events on a MKMapView or UIWebView objects? http://stackoverflow.com/questions/1049889/how-to-intercept-touches-events-on-a-mkmapview-or-uiwebview-objects it looks like when I use this class I see nothing on the Console MapViewWithTouches mapView MapViewWithTouches alloc initWithFrame self.view.frame self.view insertSubview mapView atIndex 0 Any idea what I'm doing wrong iphone objective c iphone sdk 3.0..
Placeholder in UITextView http://stackoverflow.com/questions/1328638/placeholder-in-uitextview defaultCenter addObserver self selector @selector textChanged name UITextViewTextDidChangeNotification object nil id initWithFrame CGRect frame if self super initWithFrame frame self setPlaceholder @ self setPlaceholderColor UIColor lightGrayColor NSNotificationCenter.. @selector textChanged name UITextViewTextDidChangeNotification object nil id initWithFrame CGRect frame if self super initWithFrame frame self setPlaceholder @ self setPlaceholderColor UIColor lightGrayColor NSNotificationCenter defaultCenter addObserver.. nil void drawRect CGRect rect if self placeholder length 0 if _placeHolderLabel nil _placeHolderLabel UILabel alloc initWithFrame CGRectMake 8 8 self.bounds.size.width 16 0 _placeHolderLabel.lineBreakMode NSLineBreakByWordWrapping _placeHolderLabel.numberOfLines..
Detecting which UIButton was pressed in a UITableView http://stackoverflow.com/questions/1802707/detecting-which-uibutton-was-pressed-in-a-uitableview initWithStyle UITableViewCellStyleDefault reuseIdentifier identifier cell autorelelase UIButton button UIButton alloc initWithFrame CGRectMake 10 5 40 20 button addTarget self action @selector buttonPressedAction forControlEvents UIControlEventTouchUpInside.. initWithStyle UITableViewCellStyleDefault reuseIdentifier identifier cell autorelelase UIButton button UIButton alloc initWithFrame CGRectMake 10 5 40 20 button addTarget self action @selector buttonPressedAction forControlEvents UIControlEventTouchUpInside..
Rounded UIView using CALayers - only some corners - How? http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how In the view controller add this void viewDidLoad CGRect rect CGRectMake 10 10 200 100 MyView myView MyView alloc initWithFrame rect self.view addSubview myView super viewDidLoad MyView is just a UIImageView subclass @interface MyView UIImageView I'd..
Adding view on StatusBar in iPhone http://stackoverflow.com/questions/2833724/adding-view-on-statusbar-in-iphone own window above the existing status bar. Just create a simple subclass of UIWindow with the following override of initWithFrame @interface ACStatusBarOverlayWindow UIWindow @end @implementation ACStatusBarOverlayWindow id initWithFrame CGRect frame.. of initWithFrame @interface ACStatusBarOverlayWindow UIWindow @end @implementation ACStatusBarOverlayWindow id initWithFrame CGRect frame if self super initWithFrame frame Place the window on the correct level and position self.windowLevel UIWindowLevelStatusBar.. UIWindow @end @implementation ACStatusBarOverlayWindow id initWithFrame CGRect frame if self super initWithFrame frame Place the window on the correct level and position self.windowLevel UIWindowLevelStatusBar 1.0f self.frame UIApplication..
How to customize the background/border colors of a grouped table view cell? http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell @implementation CustomCellBackgroundView @synthesize borderColor fillColor position BOOL isOpaque return NO id initWithFrame CGRect frame if self super initWithFrame frame Initialization code return self void drawRect CGRect rect Drawing code CGContextRef.. @synthesize borderColor fillColor position BOOL isOpaque return NO id initWithFrame CGRect frame if self super initWithFrame frame Initialization code return self void drawRect CGRect rect Drawing code CGContextRef c UIGraphicsGetCurrentContext..
How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar http://stackoverflow.com/questions/4471289/how-to-filter-nsfetchedresultscontroller-coredata-with-uisearchdisplaycontroll tableView endUpdates Other view information void loadView super loadView UISearchBar searchBar UISearchBar alloc initWithFrame CGRectMake 0 0 self.tableView.frame.size.width 44.0 autorelease searchBar.autoresizingMask UIViewAutoresizingFlexibleWidth..
Changing Tint / Background color of UITabBar http://stackoverflow.com/questions/571028/changing-tint-background-color-of-uitabbar viewDidLoad super viewDidLoad CGRect frame CGRectMake 0.0 0.0 self.view.bounds.size.width 48 UIView v UIView alloc initWithFrame frame v setBackgroundColor kMainColor v setAlpha 0.5 self tabBar addSubview v v release @end share improve this answer..
How to change UIPickerView height http://stackoverflow.com/questions/573979/how-to-change-uipickerview-height view by taking complete control and passing a desired frame size at creation time e.g smallerPicker UIPickerView alloc initWithFrame CGRectMake 0.0 0.0 320.0 120.0 You will discover that at various heights and widths there are visual glitches. Obviously..
Locking the Fields in MFMailComposeViewController http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller release void createWaitOverlay fade the overlay in loadingLabel @ Sending Test Drive... bgimage UIImageView alloc initWithFrame CGRectMake 0 0 320 480 bgimage.image UIImage imageNamed @ waitOverLay.png self.view addSubview bgimage bgimage.alpha 0 bgimage..
Custom colors in UITabBar http://stackoverflow.com/questions/675433/custom-colors-in-uitabbar void viewDidLoad super viewDidLoad CGRect frame CGRectMake 0.0 0 self.view.bounds.size.width 48 UIView v UIView alloc initWithFrame frame v setBackgroundColor UIColor alloc initWithRed 1.0 green 0.0 blue 0.0 alpha 0.1 tabBar1 insertSubview v atIndex..
iCloud basics and code sample [closed] http://stackoverflow.com/questions/7795629/icloud-basics-and-code-sample NSDictionary launchOptions NSLog @ AppDelegate app did finish launching self.window UIWindow alloc initWithFrame UIScreen mainScreen bounds autorelease Override point for customization after application launch. if UIDevice currentDevice..
Animate change of view controllers without using navigation controller stack, subviews or modal controllers? http://stackoverflow.com/questions/8146253/animate-change-of-view-controllers-without-using-navigation-controller-stack-su UIApplication application didFinishLaunchingWithOptions NSDictionary launchOptions self.window UIWindow alloc initWithFrame UIScreen mainScreen bounds MyViewController vc MyViewContoller alloc init... self.transitionController TransitionController..
Transparent Modal View on Navigation Controller http://stackoverflow.com/questions/849458/transparent-modal-view-on-navigation-controller root view controller . You can add the modal view directly to the view hierarchy like so UIView modalView UIView alloc initWithFrame UIScreen mainScreen bounds autorelease modalView.opaque NO modalView.backgroundColor UIColor blackColor colorWithAlphaComponent..
|