Search Results

Search found 273 results on 11 pages for 'iboutlet'.

Page 1/11 | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • problem with IBoutlet UITableView connection

    - by ideafactory
    Hi,I'm having a problem with IBoutlet UITableView connection. It seems that the IBOutlet isn't connected to the TaleView. I set the delgate and the datasource to the files owner and set the iboutlet to the tableview in the nib. The tableview is well initialized. I just want to do some reloadData and it's not working. I try to do some deselectRow just to see if it isn't reloadData problem but it doesn't deselect so i assume that the iboutlet isn't associated with my tableview. This table view is in a viewcontroller that is called as a modalViewController. Here is some code: My .h file: @interface AddEditProjectsViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UIActionSheetDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, UITextViewDelegate, UIAlertViewDelegate>{ IBOutlet UITableView *addEditProjectTable; } @property (nonatomic, retain) IBOutlet UITableView *addEditProjectTable; @end My .m file: - (void)viewWillAppear:(BOOL)animated { (...) [addEditProjectTable reloadData]; [super viewWillAppear:animated]; Thanks for any help! :)

    Read the article

  • XIB-instantiated Object's IBOutlet is nil

    - by jxpx777
    I have a XIB set up like in this screenshot: File's owner is my main window controller. The XIB is also in charge of creating an object that serves as the delegate for the MGScopeBar view. As you can see in the screenshot, the scope bar delegate has an IBOutlet for the search field so that it can return it as an extra view as part of the delegate process. The problem I'm having is that when the delegate object is queried for the accessory view, the IBOutlet NSSearchField is nil. I'm fairly certain this has something to do with the order that objects are created, IBOutlets wired, etc, but I'm just a little lost as to where in the process I can expect the search field to exist so that the scope bar delegate can reference it properly. Thanks in advance for any pointers.

    Read the article

  • iPhone - Cannont access to an IBOutlet (nil valued)

    - by Oliver
    Hello, I have a problem acessing a IBOutlet. I have a NIB inside which there is a tableview, a toolbar and an UILabel (encasulated into a view). The controller (that is the file's owner) is defined as : @interface ChoixPeriodeController : UIViewController <UITableViewDelegate> { IBOutlet UILabel* __periodeInitialeLabel; } @property(nonatomic, retain) UILabel* periodeInitialeLabel; - (void) setSelectedPeriode:(Tache_TypePeriode)typePeriode; In the .m file, this function is called by the parent window to init the Label : - (void) setSelectedPeriode:(Tache_TypePeriode)typePeriode { NSMutableString* tmpString = [NSMutableString string]; [tmpString appendFormat:bla bla bla;....]; self.periodeInitialeLabel.text = tmpString; } Into this function, I can see that self.periodeInitialeLabel is at nil. I can't see why ? Everything is connected into IB... Do you see what can be the problem ?

    Read the article

  • Interface builder problem: When hooking up an IBOutlet, getting "this class is not key value coding-

    - by Robert
    Here is what I do: 1) Create New UIViewController subclass , tick with NIB for interface builder 2) In the header: @interface QuizMainViewController : UIViewController { UILabel* aLabel; } @property (nonatomic, retain) IBOutlet UILabel* aLabel; @end 3) In the .m #import "QuizMainViewController.h" @implementation QuizMainViewController @synthesize aLabel; - (void)dealloc { [aLabel release]; [super dealloc]; } @end 4) Open the NIB In interface builder, drag a new UILabel into the view. I test the program here and it runs fine. 5) right click on file's owner, connect 'aLabel' from the Outlets to the UILabel. I run here and it crashes. Message from log: * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key aLabel.'

    Read the article

  • Exception if there is IBOutlet in view controller created by initWithNibName

    - by Kail
    When I create a Navigation-based application, the second view controller is created with initWithNibName, if I add a label onto the second view and connect it with IBOutlet in the second view controller. After I navigate to the second view by clicking table cell, and then back to the root view, the application aborts - send message retainCount to a freed object. I know this is caused by the IBOutlet label, which is retained, set nil in viewDidUnload and dealloc in dealloc. But I don't know why, and if I wanna still use IBOutlet, what can I do? Not dealloc it in viewcontroller's dealloc? Anybody could help? Thank you.

    Read the article

  • Can't connect IBOutlet in Interface Builder

    - by Dave C
    Hello, I have the following code: @interface AddResident : UIViewController { IBOutlet UITextField *FirstName; IBOutlet UISegmentedControl *Gender; } I can see both of these outlets in interface builder but can only connect the UISegmented control... the other one will not connect to my UITextField on the form. Any help is much appreciated.

    Read the article

  • IBOutlet instances are (null) after loading from NIB

    - by Zach
    I am working on an iPhone app and am getting (null) references to IBOutlet fields in my controller. I have a UIViewController subclass that is set as the File's Owner in my XIB. I have a set of UI elements that are wired into the controller. After loading from NIB and attempting to set properties on those UI elements, I find that they are (null). To clarify, some code: ExpandSearchPageController.h: @interface ExpandSearchPageController : UIViewController { IBOutlet UITextView * completeMessageView; } -(void)checkTextField; @property (nonatomic, retain) IBOutlet UITextView * completeMessageView; ExpandSearchPageController.m: @implementation ExpandSearchPageController @synthesize completeMessageView; -(void)checkTextField { NSLog(@"text field: %@",completeMessageView); } ExpandSearchPageController is set as the File's Owner for ExpandSearchPage.xib. ExpandSearchPage.xib's UITextView is wired to the completeMessageView. When I call ExpandSearchPageController * searchExpanderPage = [[ExpandSearchPageController alloc] initWithNibName:@"ExpandSearchPage" bundle:[NSBundle mainBundle]]; [searchExpanderPage checkTextField]; the result is "text field: (null)" Sorry if this is a total newb question, but I guess I'm still a newb at iPhone programming! Thanks in advance!

    Read the article

  • weak or strong for IBOutlet and other

    - by Piero
    I have switched my project to ARC, and I don't understand if I have to use strong or weak for IBOutlets. Xcode do this: in interface builder, if a create a UILabel for example and I connect it with assistant editor to my ViewController, it create this: @property (nonatomic, strong) UILabel *aLabel; It uses the strong, instead I read a tutorial on RayWenderlich website that say this: But for these two particular properties I have other plans. Instead of strong, we will declare them as weak. @property (nonatomic, weak) IBOutlet UITableView *tableView; @property (nonatomic, weak) IBOutlet UISearchBar *searchBar; Weak is the recommended relationship for all outlet properties. These view objects are already part of the view controller’s view hierarchy and don’t need to be retained elsewhere. The big advantage of declaring your outlets weak is that it saves you time writing the viewDidUnload method. Currently our viewDidUnload looks like this: - (void)viewDidUnload { [super viewDidUnload]; self.tableView = nil; self.searchBar = nil; soundEffect = nil; } You can now simplify it to the following: - (void)viewDidUnload { [super viewDidUnload]; soundEffect = nil; } So use weak, instead of the strong, and remove the set to nil in the videDidUnload, instead Xcode use the strong, and use the self... = nil in the viewDidUnload. My question is: when do I have to use strong, and when weak? I want also use for deployment target iOS 4, so when do I have to use the unsafe_unretain? Anyone can help to explain me well with a small tutorial, when use strong, weak and unsafe_unretain with ARC?

    Read the article

  • One IBOutlet for two UILabels

    - by Mike Rychev
    I have two views within one .xib (one view for landscape, another for portrait). How can I use the same IBOutlet I've defined in @interface section for both labels if they have the same functionality. (ctrl+dragging to both of them does'n help-each time I drag to second, the first one loses its outlet).

    Read the article

  • IBOutlet UILabel do not get resized

    - by Leonardo
    HI all, I have designed a view in Interface Builder and connected correctly with its controller. There some UILabel in it that are going to be filled with lot of text. But, even if I have declared "word wrap" and set line to 0 in IB, I can display only first line. I notice that if I increase the height of the UILabel in IB, all the text display properly in multi line, but I cannot do that because text may vary. Shouldn't the UILabel resize itself to fit all the text ? Also, if I built the UILabel programmatically I can succesfully accomplish a word wrap, why cannot do the same with IB ? What am I doing wrong ? thanks Leonardo

    Read the article

  • IPhone XCode programming: view called from a navigation view doesn't set its IBOutlet attributes

    - by Antonio Murgia
    I created a view Called ProgrammaView that appears when a row of a table is clicked. This view has a UILabel, a UIImageView and a UITextView. Now. ProgrammaView's Outlets have to be changed by the parameter passed to a method of the view called iniz. in this image there is first the ProgrammaView.h and then the method iniz. The problem is that the label and other stuff doesn't change! I checked 3 million times that everything between the xib file and the controller is linked. The trick to call iniz in the other viewcontrollers works well in other part of the program so i think is not that the problem. Thank you in advance!

    Read the article

  • IBOutlet on properties and exposition of the class

    - by Espuz
    Apple, for memory management issues, recommend defining outlets on properties, not in the attribute declaration. But, as far as I know, declaring properties exposes the class to external classes, so this could be dangerous. On UIViewController we have the main view definition and the logic, so MVC is slightly cheated in this cases. What is the beteer approach, Apples's recommendation for memory-management or armored classes?

    Read the article

  • iPhone SDK/General Xcode question.

    - by user354779
    In the iPhone SDK, in my .n, I can say: -(IBOutlet) UITextField *MyNameIs; -(IBOutlet) UILabel *DisplayMyNameIsHere; } -(IBAction)PressButtonToDisplayYourName; Then in my .m, I'll do: -(IBAction)PressButtonToDisplayYourName { DisplayMyNameIsHere = MyNameIs.text; } But now how would I translate that to making a Mac application. If I wanted to display someones name from a textfield in a label? I have been trying to figure this out, but the ".text" extension only works in the iPhone SDK, not the Mac SDK. Someone please help! Thanks!

    Read the article

  • Defined outlets, connected them, everything looks fine, nothing works.

    - by Tom
    Hi! I'm trying to play with a WebView. I made an outlet: IBOutlet UIWebView *browser; Defined it as a property: @property (nonatomic, retain) IBOutlet UIWebView *browser; Synthethized it: @synthesize browser; Finally, I connected it in Interface Builder, really it is. Then I try to do something with it i.e.: [browser loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://apple.com"]]]; Or also: Etape *etape = [[Etape alloc] init]; NSString *html = [etape generateHTMLforEtape:[current_etape objectAtIndex:0]]; [browser loadHTMLString:html baseURL:nil]; [etape release]; I get no errors, I tried to Build & Analyse, no notices or warnings or errors.. I've been searching for one whole day, please help me :/ Thanks a lot! EDIT: Here's screenshots of my connections for my WebView:

    Read the article

  • Play a sound based on the button pressed on the IPhone/xcode.

    - by slickplaid
    I'm trying to play a sound based on which button is pressed using AVAudioPlayer. (This is not a soundboard or fart app.) I have linked all buttons using this code in the header file: @interface appViewController : UIViewController <AVAudioPlayerDelegate> { AVAudioPlayer *player; UIButton *C4; UIButton *Bb4; UIButton *B4; UIButton *A4; UIButton *Ab4; UIButton *As4; UIButton *G3; UIButton *Gb3; UIButton *Gs3; UIButton *F3; UIButton *Fs3; UIButton *E3; UIButton *Eb3; UIButton *D3; UIButton *Db3; UIButton *Ds3; UIButton *C3; UIButton *Cs3; } @property (nonatomic, retain) AVAudioPlayer *player; @property (nonatomic, retain) IBOutlet UIButton *C4; @property (nonatomic, retain) IBOutlet UIButton *B4; @property (nonatomic, retain) IBOutlet UIButton *Bb4; @property (nonatomic, retain) IBOutlet UIButton *A4; @property (nonatomic, retain) IBOutlet UIButton *Ab4; @property (nonatomic, retain) IBOutlet UIButton *As4; @property (nonatomic, retain) IBOutlet UIButton *G3; @property (nonatomic, retain) IBOutlet UIButton *Gb3; @property (nonatomic, retain) IBOutlet UIButton *Gs3; @property (nonatomic, retain) IBOutlet UIButton *F3; @property (nonatomic, retain) IBOutlet UIButton *Fs3; @property (nonatomic, retain) IBOutlet UIButton *E3; @property (nonatomic, retain) IBOutlet UIButton *Eb3; @property (nonatomic, retain) IBOutlet UIButton *D3; @property (nonatomic, retain) IBOutlet UIButton *Db3; @property (nonatomic, retain) IBOutlet UIButton *Ds3; @property (nonatomic, retain) IBOutlet UIButton *C3; @property (nonatomic, retain) IBOutlet UIButton *Cs3; - (IBAction) playNote; @end Buttons are all linked to the event "playNote" in interfaceBuilder and each note is linked to the proper referencing outlet according to note name. All *.mp3 sound files are named after the UIButton name (IE- C3 == C3.mp3). In my implementation file, I have this to play a only one note when the C3 button is pressed: #import "sonicfitViewController.h" @implementation appViewController @synthesize C3, Cs3, D3, Ds3, Db3, E3, Eb3, F3, Fs3, G3, Gs3, A4, Ab4, As4, B4, Bb4, C4; // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { NSString *path = [[NSBundle mainBundle] pathForResource:@"3C" ofType:@"mp3"]; NSLog(@"path: %@", path); NSURL *file = [[NSURL alloc] initFileURLWithPath:path]; AVAudioPlayer *p = [[AVAudioPlayer alloc] initWithContentsOfURL:file error:nil]; [file release]; self.player = p; [p release]; [player prepareToPlay]; [player setDelegate:self]; [super viewDidLoad]; } - (IBAction) playNote { [self.player play]; } Now, with the above I have two issues: First, the NSLog reports NULL and crashes when trying to play the file. I have added the mp3's to the resources folder and they have been copied and not just linked. They are not in an subfolder under the resources folder. Secondly, how can I set it up so that when say button C3 is pressed, it plays C3.mp3 and F3 plays F3.mp3 without writing duplicate lines of code for each different button? playNote should be like NSString *path = [[NSBundle mainBundle] pathForResource:nameOfButton ofType:@"mp3"]; instead of defining it specifically (@"C3"). Is there a better way of doing this and why does the *path report NULL and crash when I load the app? I'm pretty sure it's something as simple as adding additional variable inputs to - (IBAction) playNote:buttonName and putting all the code to call AVAudioPlayer in the playNote function but I'm unsure of the code to do this.

    Read the article

  • iPhone: custom UITableViewCell with Interface Builder -> how to release cell objects?

    - by Stefan Klumpp
    The official documentation tells me I've to do these 3 things in order to manage the my memory for "nib objects" correctly. @property (nonatomic, retain) IBOutlet UIUserInterfaceElementClass *anOutlet; "You should then either synthesize the corresponding accessor methods, or implement them according to the declaration, and (in iPhone OS) release the corresponding variable in dealloc." - (void)viewDidUnload { self.anOutlet = nil; [super viewDidUnload]; } That makes sense for a normal view. However, how am I gonna do that for a UITableView with custom UITableViewCells loaded through a .nib-file? There the IBOutlets are in MyCustomCell.h (inherited from UITableViewCell), but that is not the place where I load the nib and apply it to the cell instances, because that happens in MyTableView.m So do I still release the IBOutlets in the dealloc of MyCustomCell.m or do I have to do something in MyTableView.m? Also MyCustomCell.m doesn't have a - (void)viewDidUnload {} where I can set my IBOutlets to nil, while my MyTableView.m does.

    Read the article

  • I can't seem to connecting any of my IBOutlets between IB and XCode.

    - by Bonnie
    I created a new iPhone project using the built-in "tab bar" template. I put a few sliders, labels, textfields in the view. I added in needed code for: "IBOutlet, @property, @synthesize, and release" for the above UI objects. It saves and compiles without any errors or warnings. I try to hook-up my connections with control-drag, but don't see any of my IBOutlets appearing in the list. I can't seem to "connect" any outlets from IB to my code. (My IBActions all connect fine) What did I do wrong?

    Read the article

  • Issues using UITapGestureRecognizers in Interface Builder

    - by 5StringRyan
    I'm attempting to use the UITapGestureRecognizer object that can be found in Interface Builder. I've dragged a single "UITapGestureRecognizer" from the object library to a single view xib. I then create an IBAction method from this tap gesture, for a simple test, I'm just printing an "NSLog" message to the console once there is a tap on the view. I've run this, and the tap method isn't being called. I right click the view in IB and I noticed that there is a warning "!" on the view's "Outlook Collections" I see: Outlook Collections gestureRecognizers - Tap Gesture Recognizer (!) The warning states: UIView does not have an outlet collection named gestureRecognizers. What do I need to do to remedy this?

    Read the article

  • Where is my object allocation and memory leak in this iPhone/objective C code?

    - by Spottswoode
    Hello, I'm still a rookie when it comes to this programming gig and was wondering if someone could help me smooth out this code. Functionally, the code works great and does what I need it to do. But when I run the performance tool the allocation graph peaks, the CPU load is high, there's a leak(s), and I've also confirmed when running on my iPhone it seems noticeably slower then the rest of the components in my app. I'd appreciate any advice/tips/help anyone could give me. :) Thanks in advance! .h file // // Time_CalculatorViewController.h // Time Calculator // // Created by Adam Soloway on 2/19/10. // Copyright Legacy Pilots 2010. All rights reserved. // #import <UIKit/UIKit.h> @interface Time_CalculatorViewController : UIViewController { //BOOL moveViewUp; //CGFloat scrollAmount; IBOutlet UILabel *hoursLabel; IBOutlet UILabel *minutesLabel; IBOutlet UILabel *hoursDecimalLabel; IBOutlet UILabel *minutesDecimalLabel; IBOutlet UILabel *errorLabel; IBOutlet UITextField *minTextField1; IBOutlet UITextField *minTextField2; IBOutlet UITextField *minTextField3; IBOutlet UITextField *minTextField4; IBOutlet UITextField *minTextField5; IBOutlet UITextField *minTextField6; IBOutlet UITextField *minTextField7; IBOutlet UITextField *minTextField8; IBOutlet UITextField *minTextField9; IBOutlet UITextField *minTextField10; IBOutlet UITextField *hourTextField1; IBOutlet UITextField *hourTextField2; IBOutlet UITextField *hourTextField3; IBOutlet UITextField *hourTextField4; IBOutlet UITextField *hourTextField5; IBOutlet UITextField *hourTextField6; IBOutlet UITextField *hourTextField7; IBOutlet UITextField *hourTextField8; IBOutlet UITextField *hourTextField9; IBOutlet UITextField *hourTextField10; IBOutlet UIButton *resetAll; NSString *minutesString1; NSString *minutesString2; NSString *minutesString3; NSString *minutesString4; NSString *minutesString5; NSString *minutesString6; NSString *minutesString7; NSString *minutesString8; NSString *minutesString9; NSString *minutesString10; NSString *hoursString1; NSString *hoursString2; NSString *hoursString3; NSString *hoursString4; NSString *hoursString5; NSString *hoursString6; NSString *hoursString7; NSString *hoursString8; NSString *hoursString9; NSString *hoursString10; int hourDecimalNumber; int totalTime; int leftOverMinutes; int minuteNumber1; int minuteNumber2; int minuteNumber3; int minuteNumber4; int minuteNumber5; int minuteNumber6; int minuteNumber7; int minuteNumber8; int minuteNumber9; int minuteNumber10; int hourNumber1; int hourNumber2; int hourNumber3; int hourNumber4; int hourNumber5; int hourNumber6; int hourNumber7; int hourNumber8; int hourNumber9; int hourNumber10; } //- (void)scrollTheView:(BOOL)movedUp; - (void)calculateTime; - (IBAction)resetAllValues; @end .m file // // Time_CalculatorViewController.m // Time Calculator // // Created by Adam Soloway on 2/19/10. // Copyright Legacy Pilots 2010. All rights reserved. // #import "Time_CalculatorViewController.h" @implementation Time_CalculatorViewController - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if( minTextField1.editing || minTextField2.editing || minTextField3.editing || minTextField4.editing || minTextField5.editing || minTextField6.editing || minTextField7.editing || minTextField8.editing || minTextField9.editing || minTextField10.editing || hourTextField1.editing || hourTextField2.editing || hourTextField3.editing || hourTextField4.editing || hourTextField5.editing || hourTextField6.editing || hourTextField7.editing || hourTextField8.editing || hourTextField9.editing || hourTextField10.editing) { [minTextField1 resignFirstResponder]; [minTextField2 resignFirstResponder]; [minTextField3 resignFirstResponder]; [minTextField4 resignFirstResponder]; [minTextField5 resignFirstResponder]; [minTextField6 resignFirstResponder]; [minTextField7 resignFirstResponder]; [minTextField8 resignFirstResponder]; [minTextField9 resignFirstResponder]; [minTextField10 resignFirstResponder]; [hourTextField1 resignFirstResponder]; [hourTextField2 resignFirstResponder]; [hourTextField3 resignFirstResponder]; [hourTextField4 resignFirstResponder]; [hourTextField5 resignFirstResponder]; [hourTextField6 resignFirstResponder]; [hourTextField7 resignFirstResponder]; [hourTextField8 resignFirstResponder]; [hourTextField9 resignFirstResponder]; [hourTextField10 resignFirstResponder]; [self calculateTime]; //if (moveViewUp) [self scrollTheView:NO]; } [super touchesBegan:touches withEvent:event]; } /* // The designated initializer. Override to perform setup that is required before the view is loaded. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } */ /* // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { } */ // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [minutesString1 release]; [minutesString2 release]; [minutesString3 release]; [minutesString4 release]; [minutesString5 release]; [minutesString6 release]; [minutesString7 release]; [minutesString8 release]; [minutesString9 release]; [minutesString10 release]; [hoursString1 release]; [hoursString2 release]; [hoursString3 release]; [hoursString4 release]; [hoursString5 release]; [hoursString6 release]; [hoursString7 release]; [hoursString8 release]; [hoursString9 release]; [hoursString10 release]; [super dealloc]; } -(BOOL)textFieldShouldReturn:(UITextField *)theTextField { //[minTextField10 resignFirstResponder]; //if (moveViewUp) [self scrollTheView:NO]; [self calculateTime]; return YES; } - (IBAction)resetAllValues { minTextField1.text = 0; minTextField2.text = 0; minTextField3.text = 0; minTextField4.text = 0; minTextField5.text = 0; minTextField6.text = 0; minTextField7.text = 0; minTextField8.text = 0; minTextField9.text = 0; minTextField10.text = 0; hourTextField1.text = 0; hourTextField2.text = 0; hourTextField3.text = 0; hourTextField4.text = 0; hourTextField5.text = 0; hourTextField6.text = 0; hourTextField7.text = 0; hourTextField8.text = 0; hourTextField9.text = 0; hourTextField10.text = 0; totalTime = 0; leftOverMinutes = 0; hoursLabel.text = [NSString stringWithFormat:@"0"]; hourDecimalNumber = 0; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; minutesDecimalLabel.text = [NSString stringWithFormat:@"0"]; self.calculateTime; } - (void)calculateTime { minutesString1 = minTextField1.text; minutesString2 = minTextField2.text; minutesString3 = minTextField3.text; minutesString4 = minTextField4.text; minutesString5 = minTextField5.text; minutesString6 = minTextField6.text; minutesString7 = minTextField7.text; minutesString8 = minTextField8.text; minutesString9 = minTextField9.text; minutesString10 = minTextField10.text; hoursString1 = hourTextField1.text; hoursString2 = hourTextField2.text; hoursString3 = hourTextField3.text; hoursString4 = hourTextField4.text; hoursString5 = hourTextField5.text; hoursString6 = hourTextField6.text; hoursString7 = hourTextField7.text; hoursString8 = hourTextField8.text; hoursString9 = hourTextField9.text; hoursString10 = hourTextField10.text; minuteNumber1 = [minutesString1 intValue]; minuteNumber2 = [minutesString2 intValue]; minuteNumber3 = [minutesString3 intValue]; minuteNumber4 = [minutesString4 intValue]; minuteNumber5 = [minutesString5 intValue]; minuteNumber6 = [minutesString6 intValue]; minuteNumber7 = [minutesString7 intValue]; minuteNumber8 = [minutesString8 intValue]; minuteNumber9 = [minutesString9 intValue]; minuteNumber10 = [minutesString10 intValue]; hourNumber1 = ([hoursString1 intValue] * 60); hourNumber2 = ([hoursString2 intValue] * 60); hourNumber3 = ([hoursString3 intValue] * 60); hourNumber4 = ([hoursString4 intValue] * 60); hourNumber5 = ([hoursString5 intValue] * 60); hourNumber6 = ([hoursString6 intValue] * 60); hourNumber7 = ([hoursString7 intValue] * 60); hourNumber8 = ([hoursString8 intValue] * 60); hourNumber9 = ([hoursString9 intValue] * 60); hourNumber10 = ([hoursString10 intValue] * 60); totalTime = (hourNumber1 + hourNumber2 +hourNumber3 +hourNumber4 +hourNumber5 +hourNumber6 +hourNumber7 +hourNumber8 +hourNumber9 +hourNumber10 + minuteNumber1 + minuteNumber2 + minuteNumber3 + minuteNumber4 + minuteNumber5 +minuteNumber6 + minuteNumber7 + minuteNumber8 + minuteNumber9 + minuteNumber10); if (totalTime <= 59) { leftOverMinutes = totalTime; hoursLabel.text = [NSString stringWithFormat:@"0"]; hourDecimalNumber = 0; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >59 && totalTime <= 119){ leftOverMinutes = totalTime - 60; hoursLabel.text = [NSString stringWithFormat:@"1"]; hourDecimalNumber = 1; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >119 && totalTime <= 179){ leftOverMinutes = totalTime - 120; hoursLabel.text = [NSString stringWithFormat:@"2"]; hourDecimalNumber = 2; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >179 && totalTime <= 239){ leftOverMinutes = totalTime - 180; hoursLabel.text = [NSString stringWithFormat:@"3"]; hourDecimalNumber = 3; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >239 && totalTime <= 299){ leftOverMinutes = totalTime - 240; hoursLabel.text = [NSString stringWithFormat:@"4"]; hourDecimalNumber = 4; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >299 && totalTime <= 359){ leftOverMinutes = totalTime - 300; hoursLabel.text = [NSString stringWithFormat:@"5"]; hourDecimalNumber = 5; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >359 && totalTime <= 419){ leftOverMinutes = totalTime - 360; hoursLabel.text = [NSString stringWithFormat:@"6"]; hourDecimalNumber = 6; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >419 && totalTime <= 479){ leftOverMinutes = totalTime - 420; hoursLabel.text = [NSString stringWithFormat:@"7"]; hourDecimalNumber = 7; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >479 && totalTime <= 539){ leftOverMinutes = totalTime - 480; hoursLabel.text = [NSString stringWithFormat:@"8"]; hourDecimalNumber = 8; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >539 && totalTime <= 599){ leftOverMinutes = totalTime - 540; hoursLabel.text = [NSString stringWithFormat:@"9"]; hourDecimalNumber = 9; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >599 && totalTime <= 659){ leftOverMinutes = totalTime - 600; hoursLabel.text = [NSString stringWithFormat:@"10"]; hourDecimalNumber = 10; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >659 && totalTime <= 719){ leftOverMinutes = totalTime - 660; hoursLabel.text = [NSString stringWithFormat:@"11"]; hourDecimalNumber = 11; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >719 && totalTime <= 779){ leftOverMinutes = totalTime - 720; hoursLabel.text = [NSString stringWithFormat:@"12"]; hourDecimalNumber = 12; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >779 && totalTime <= 839){ leftOverMinutes = totalTime - 780; hoursLabel.text = [NSString stringWithFormat:@"13"]; hourDecimalNumber = 13; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >839 && totalTime <= 899){ leftOverMinutes = totalTime - 840; hoursLabel.text = [NSString stringWithFormat:@"14"]; hourDecimalNumber = 14; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >899 && totalTime <= 959){ leftOverMinutes = totalTime - 900; hoursLabel.text = [NSString stringWithFormat:@"15"]; hourDecimalNumber = 15; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >959 && totalTime <= 1019){ leftOverMinutes = totalTime - 960; hoursLabel.text = [NSString stringWithFormat:@"16"]; hourDecimalNumber = 16; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1019 && totalTime <= 1079){ leftOverMinutes = totalTime - 1020; hoursLabel.text = [NSString stringWithFormat:@"17"]; hourDecimalNumber = 17; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1079 && totalTime <= 1139){ leftOverMinutes = totalTime - 1080; hoursLabel.text = [NSString stringWithFormat:@"18"]; hourDecimalNumber = 18; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1139 && totalTime <= 1199){ leftOverMinutes = totalTime - 1140; hoursLabel.text = [NSString stringWithFormat:@"19"]; hourDecimalNumber = 19; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1199 && totalTime <= 1259){ leftOverMinutes = totalTime - 1200; hoursLabel.text = [NSString stringWithFormat:@"20"]; hourDecimalNumber = 20; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1259 && totalTime <= 1319){ leftOverMinutes = totalTime - 1260; hoursLabel.text = [NSString stringWithFormat:@"21"]; hourDecimalNumber = 21; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1319 && totalTime <= 1379){ leftOverMinutes = totalTime - 1320; hoursLabel.text = [NSString stringWithFormat:@"22"]; hourDecimalNumber = 22; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1379 && totalTime <= 1439){ leftOverMinutes = totalTime - 1380; hoursLabel.text = [NSString stringWithFormat:@"23"]; hourDecimalNumber = 23; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1439 && totalTime <= 1499){ leftOverMinutes = totalTime - 1440; hoursLabel.text = [NSString stringWithFormat:@"24"]; hourDecimalNumber = 24; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1499 && totalTime <= 1559){ leftOverMinutes = totalTime - 1500; hoursLabel.text = [NSString stringWithFormat:@"25"]; hourDecimalNumber = 25; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1559 && totalTime <= 1619){ leftOverMinutes = totalTime - 1560; hoursLabel.text = [NSString stringWithFormat:@"26"]; hourDecimalNumber = 26; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1619 && totalTime <= 1679){ leftOverMinutes = totalTime - 1620; hoursLabel.text = [NSString stringWithFormat:@"27"]; hourDecimalNumber = 27; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1679 && totalTime <= 1739){ leftOverMinutes = totalTime - 1680; hoursLabel.text = [NSString stringWithFormat:@"28"]; hourDecimalNumber = 28; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1739 && totalTime <= 1799){ leftOverMinutes = totalTime - 1740; hoursLabel.text = [NSString stringWithFormat:@"29"]; hourDecimalNumber = 29; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1799 && totalTime <= 1859){ leftOverMinutes = totalTime - 1800; hoursLabel.text = [NSString stringWithFormat:@"30"]; hourDecimalNumber = 30; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; errorLabel.hidden = TRUE; } else if (totalTime >1859){ hoursLabel.text = [NSString stringWithFormat:@"Error"]; hoursDecimalLabel.text = [NSString stringWithFormat:@"Error"]; errorLabel.hidden = FALSE; } //Minutes Label if (leftOverMinutes < 10) { minutesLabel.text = [NSString stringWithFormat:@"0%d", leftOverMinutes]; } else minutesLabel.text = [NSString stringWithFormat:@"%d", leftOverMinutes]; //Minutes Decimal Label if (leftOverMinutes >=0 && leftOverMinutes <=2) { minutesDecimalLabel.text = [NSString stringWithFormat:@"0"]; } else if (leftOverMinutes >=3 && leftOverMinutes <=8){ minutesDecimalLabel.text = [NSString stringWithFormat:@"1"]; } else if (leftOverMinutes >=9 && leftOverMinutes <=14){ minutesDecimalLabel.text = [NSString stringWithFormat:@"2"]; } else if (leftOverMinutes >=15 && leftOverMinutes <=20){ minutesDecimalLabel.text = [NSString stringWithFormat:@"3"]; } else if (leftOverMinutes >=21 && leftOverMinutes <=26){ minutesDecimalLabel.text = [NSString stringWithFormat:@"4"]; } else if (leftOverMinutes >=27 && leftOverMinutes <=32){ minutesDecimalLabel.text = [NSString stringWithFormat:@"5"]; } else if (leftOverMinutes >=33 && leftOverMinutes <=38){ minutesDecimalLabel.text = [NSString stringWithFormat:@"6"]; } else if (leftOverMinutes >=39 && leftOverMinutes <=44){ minutesDecimalLabel.text = [NSString stringWithFormat:@"7"]; } else if (leftOverMinutes >=45 && leftOverMinutes <=50){ minutesDecimalLabel.text = [NSString stringWithFormat:@"8"]; } else if (leftOverMinutes >=51 && leftOverMinutes <=56){ minutesDecimalLabel.text = [NSString stringWithFormat:@"9"]; } else if (leftOverMinutes >=57 && leftOverMinutes <=60){ minutesDecimalLabel.text = [NSString stringWithFormat:@"0"]; hourDecimalNumber = hourDecimalNumber + 1; hoursDecimalLabel.text = [NSString stringWithFormat:@"%i", hourDecimalNumber]; } } @end

    Read the article

  • error: expected specifier-qualifier-list before...in Objective C ?

    - by Ridwan
    Hi guys. Whenever I build the following code, I get the error above. //Controller.h #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "PolygonShape.h" #import "PolygonView.h"; @interface Controller : NSObject { IBOutlet UIButton *decreaseButton; IBOutlet UIButton *increaseButton; IBOutlet UILabel *numberOfSidesLabel; IBOutlet PolygonShape *shape; IBOutlet PolygonView *shapeView; } - (IBAction)decrease; - (IBAction)increase; - (void)awakeFromNib; @end //Controller.m #import "Controller.h" @implementation Controller @end However, when I replace the import statement and put a forward class reference instead, the code compiles. //Controller.h #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "PolygonShape.h" @class PolygonView; @interface Controller : NSObject { IBOutlet UIButton *decreaseButton; IBOutlet UIButton *increaseButton; IBOutlet UILabel *numberOfSidesLabel; IBOutlet PolygonShape *shape; IBOutlet PolygonView *shapeView; } - (IBAction)decrease; - (IBAction)increase; - (void)awakeFromNib; @end //Controller.m #import "Controller.h" #import "PolygonView.h" @implementation Controller @end Can anyone explain?

    Read the article

  • [NSCustomView isOpaque]: message sent to deallocated instance 0x123456

    - by JxXx
    Hi all I receive that message in debugger console since I added the following arguments for debugging my application with XCode. NSZombieEnabled: YES NSZombieLevel: 16 I was looking for zombie objects... Before doing so, the application failed before I could know where what and why was happening.... Now I´m pretty sure that 'something' outside code is trying to access an object previously released and I can't know where or why it happens neither where it was released... My application is based on this proof of concept (very interesting and colorful) of QuartzCore Framework: http://www.cimgf.com/2008/03/03/core-animation-tutorial-wizard-dialog-with-transitions/ Based on it, I added a few more nsviews to my project and a title and an index to each one, also I added some buttons, text and images depending on what 'dialog' (ACLinkedView object) it was... The transition from an ACLinkedView object to another is going through a validation that depends on the view where you are ... As you see I used this proof of concept as the foundation of my application and it grew and grew into an application that makes use of configuration files, web services (using gSOAP and C ...) I hope you can give me some clues to where is my error ... I´ve been the hole week debugging unsuccessfully, as I said before, I think that that message comes from a point outside my code. I'd say that the problem s related with bad memory allocation or automatisms (nearly completely unknowns for me) during loading the nib components... I will try to explain all this with parts of mycode. This is my ACLinkedView definition: #import <Cocoa/Cocoa.h> @interface ACLinkedView : NSView { // The Window (to close it if needed) IBOutlet NSWindow *mainWindow; // Linked Views IBOutlet ACLinkedView *previousView; IBOutlet ACLinkedView *nextView; // Buttons IBOutlet NSButton *previousButton; IBOutlet NSButton *nextButton; IBOutlet NSButton *helpButton; //It has to be a Button!! IBOutlet NSImageView *bannerImg; NSString *sName; int iPosition; } - (void) SetName: (NSString*) Name; - (void) SetPosition: (int) Position; - (NSString*) GetName; - (int) GetPosition; - (void) windowWillClose:(NSNotification*)aNotification; @property (retain) NSWindow *mainWindow; @property (retain) ACLinkedView *previousView, *nextView; @property (retain) NSButton *previousButton, *nextButton, *helpButton; @property (retain) NSImageView *bannerImg; @property (retain) NSString *sName; @end The ACLinkedView's AwakeFromNib is this: #import <Cocoa/Cocoa.h> @interface ACLinkedView : NSView { // The Window (to close it if needed) IBOutlet NSWindow *mainWindow; // Linked Views IBOutlet ACLinkedView *previousView; IBOutlet ACLinkedView *nextView; // Buttons IBOutlet NSButton *previousButton; IBOutlet NSButton *nextButton; IBOutlet NSButton *helpButton; //It has to be a Button!! IBOutlet NSImageView *bannerImg; NSString *sName; int iPosition; } - (void) SetName: (NSString*) Name; - (void) SetPosition: (int) Position; - (NSString*) GetName; - (int) GetPosition; - (void) windowWillClose:(NSNotification*)aNotification; @property (retain) NSWindow *mainWindow; @property (retain) ACLinkedView *previousView, *nextView; @property (retain) NSButton *previousButton, *nextButton, *helpButton; @property (retain) NSImageView *bannerImg; @property (retain) NSString *sName; @end (As you can see the initialization of each ACLinkedView object depends on it's position wich is seted up into the Interface Builder by linking actions, buttons and CustomViews... Does I explain enough? Do you think that I should put more of my code here, i.e. AppDelegate definition or it´s awakeFromNib method? Can you help me in any way? Thanks in advance. Juan

    Read the article

  • Why doesn't IB see my IBAction?

    - by Dan Ray
    I've been staring at this for way too long. There's nothing fancy happening here, and I've done this dozens of times, yet Interface Builder steadfastly refuses to provide me an action target for -(IBAction)slideDirections. I'm at the point where I'm willing to post publicly and feel stupid. So let 'er rip. Here's my .h: #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface PulseDetailController : UIViewController { NSDictionary *pulse; IBOutlet MKMapView *map; IBOutlet UIWebView *directions; IBOutlet UIView *directionsSlider; BOOL directionsExtended; IBOutlet UILabel *vendor; IBOutlet UILabel *offer; IBOutlet UILabel *offerText; IBOutlet UILabel *hours; IBOutlet UILabel *minutes; IBOutlet UILabel *seconds; IBOutlet UILabel *distance } @property (nonatomic, retain) NSDictionary *pulse; @property (nonatomic, retain) MKMapView *map; @property (nonatomic, retain) UIWebView *directions; @property (nonatomic, retain) UIView *directionsSlider; @property (nonatomic) BOOL directionsExtended; @property (nonatomic, retain) UILabel *vendor; @property (nonatomic, retain) UILabel *offer; @property (nonatomic, retain) UILabel *offerText; @property (nonatomic, retain) UILabel *hours; @property (nonatomic, retain) UILabel *minutes; @property (nonatomic, retain) UILabel *seconds; @property (nonatomic, retain) UILabel *distance; -(IBAction)slideDirections; @end

    Read the article

  • Pass Variables In Inheritance (Obj - C)

    - by Marmik Shah
    I working on a project in Obj-C where i have a base class (ViewController) and a Derived Class (MultiPlayer). Now i have declared certain variables and properties in the base class. My properties are getting accessed from the derived class but im not able to access the variables (int,char and bool type). I'm completely new to Obj-C so i have no clue whats wrong. I have used the data types which are used in C and C++. Is there some specific way to declare variables in Obj-C?? If so, How? Here are my files ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property (weak,nonatomic) IBOutlet UIImageView* backGroungImage; @property (strong,nonatomic) IBOutlet UIImageView *blockView1; @property (strong,nonatomic) IBOutlet UIImageView *blockView2; @property (strong,nonatomic) IBOutlet UIImageView *blockView3; @property (strong,nonatomic) IBOutlet UIImageView *blockView4; @property (strong,nonatomic) IBOutlet UIImageView *blockView5; @property (strong,nonatomic) IBOutlet UIImageView *blockView6; @property (strong,nonatomic) IBOutlet UIImageView *blockView7; @property (strong,nonatomic) IBOutlet UIImageView *blockView8; @property (strong,nonatomic) IBOutlet UIImageView *blockView9; @property (strong,nonatomic) UIImage *x; @property (strong,nonatomic) UIImage *O; @property (strong,nonatomic) IBOutlet UIImageView* back1; @property (strong,nonatomic) IBOutlet UIImageView* back2; @end ViewController.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController int chooseTheBackground = 0; int movesToDecideXorO = 0; int winningArrayX[3]; int winningArrayO[3]; int blocksTotal[9] = {8,3,4,1,5,9,6,7,2}; int checkIfContentInBlocks[9] = {0,0,0,0,0,0,0,0,0}; char determineContentInBlocks[9] = {' ',' ',' ',' ',' ',' ',' ',' ',' '}; bool player1Win = false; bool player2Win = false; bool playerWin = false; bool computerWin = false; - (void)viewDidLoad { [super viewDidLoad]; if(chooseTheBackground==0) { UIImage* backImage = [UIImage imageNamed:@"MainBack1.png"]; _backGroungImage.image=backImage; } if(chooseTheBackground==1) { UIImage* backImage = [UIImage imageNamed:@"MainBack2.png"]; _backGroungImage.image=backImage; } } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end I am not able to use the above declared variables in my derived classes!

    Read the article

  • iPhone SDK can't get UIScrollView to work with a UIWebView

    - by Maxwell Segal
    I am building an app that in part of it has two views - one portrait and one landscape. And I want to offer scrolling and pinch & zooming on the landscape orientation. I've built the two views and the simple UIImages in the landscape view all work OK but it does not seem to insert my UIWebView into the UIScrollView. I've done this before with UIImage and all was OK but I must be missing something here - can anybody help with some advice. I'm sure it's something very simple - perhaps to do with the adding of the subview??. Thanks in advance of your help. I've shown the relevant parts of my code below: @interface MonthViewController : UIViewController <UIScrollViewDelegate> { MonthViewController *monthController; IBOutlet UIView *portraitView; IBOutlet UIView *landscapeView; IBOutlet UIWebView *monthKWHChartPortrait; UIWebView *monthKWHChartLandscape; IBOutlet UIScrollView *scrollChartLandscape; IBOutlet UIImageView *eLogoPortrait; IBOutlet UIImageView *eLogoLandscape; IBOutlet UIImageView *clientLogoPortrait; IBOutlet UIImageView *clientLogoLandscape; IBOutlet UIActivityIndicatorView *loadIndicatorPortrait; IBOutlet UIActivityIndicatorView *loadIndicatorLandscape; NSTimer *timer; IBOutlet UILabel *test; } -(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollChartLandscape { return monthKWHChartLandscape; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); } -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [super willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:duration]; if (toInterfaceOrientation ==UIInterfaceOrientationLandscapeRight) { NSLog(@"right"); test.text=@"right"; NSString *urlAddressLandscape = @"http://PRIVATEURLHERE.aspx?WIDTH=440"; NSURL *urlLandscape = [NSURL URLWithString:urlAddressLandscape]; NSURLRequest *requestObjLandscape = [NSURLRequest requestWithURL:urlLandscape]; [self.monthKWHChartLandscape loadRequest:requestObjLandscape]; scrollChartLandscape.contentSize = CGSizeMake(monthKWHChartLandscape.frame.size.width, monthKWHChartLandscape.frame.size.height); scrollChartLandscape.maximumZoomScale = 2.5; scrollChartLandscape.minimumZoomScale = 0.6; scrollChartLandscape.showsHorizontalScrollIndicator = YES; scrollChartLandscape.showsVerticalScrollIndicator = YES; scrollChartLandscape.clipsToBounds = YES; scrollChartLandscape.delegate = self; [self.scrollChartLandscape addSubview:monthKWHChartLandscape]; self.view=landscapeView; //self.view.transform=CGAffineTransformMakeRotation(deg2rad*(90)); //self.view.bounds=CGRectMake(0.0, 0.0, 480.0, 320.0); } else

    Read the article

1 2 3 4 5 6 7 8 9 10 11  | Next Page >