Search Results

Search found 3855 results on 155 pages for 'ipad orientation'.

Page 72/155 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • textview.selectedRange.location in UITextview show 2147483647

    - by Risma
    hi i have a textview and i want to get the selectedRange.location value from that textview. in the first time when the keyboard appear, the location value always show an integer point such as 110, or others. But if i dissappear the keyboard and then appear the keyboard again, the location value always show 2147483647. What is this 2147483647 mean and how to get the real location value? This is my code in the keyboard will appear method : -(void)keyboardWillAppear:(NSNotification *)notification { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; CGRect keyboardEndingUncorrectedFrame = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey ] CGRectValue]; CGRect keyboardEndingFrame = [self.view convertRect:keyboardEndingUncorrectedFrame fromView:nil]; [UIView commitAnimations]; NSRange selectedRange = textview.selectedRange; NSLog(@"selected Range location : %f", selectedRange.location); }

    Read the article

  • Vfr/reader when to read a page

    - by juliet
    I downloaded vfr reader soure code on github. I am reading it, I found when need show a page of PDF, it will call showdocument method in showdocument method, it will new a readercontentview in readercontentview it will new a readercontentpage which has a citiedlayer delegate method called drawlayer:incontext I don't understand when and how to call this method, because there is no update for the readercontentview.

    Read the article

  • UIImage Object surprisingly returning null but not NSData

    - by riyaz
    i have created a sqlite db. and i have insert a few datas in my db.. UIImage * imagee=[UIImage imageNamed:@"image.png"]; NSData *mydata=[NSData dataWithData:UIImagePNGRepresentation(imagee)]; const char *dbpath = [databasePath UTF8String]; NSString *insertSQL=[NSString stringWithFormat:@"insert into CONTACTS values(\"%@\",\"%@\")",@"Mathan",mydata]; NSLog(@"mydata %@",mydata); sqlite3_stmt *addStatement; const char *insert_stmt=[insertSQL UTF8String]; if (sqlite3_open(dbpath,&contactDB)==SQLITE_OK) { sqlite3_prepare_v2(contactDB,insert_stmt,-1,&addStatement,NULL); if (sqlite3_step(addStatement)==SQLITE_DONE) { sqlite3_bind_blob(addStatement,1, [mydata bytes], [mydata length], SQLITE_TRANSIENT); NSLog(@"Data saved"); } else{ NSLog(@"Some Error occured"); } sqlite3_close(contactDB); } else{ NSLog(@"Failure"); } have written some codes to retrive the data sqlite3_stmt *statement; if (sqlite3_open([databasePath UTF8String], &contactDB) == SQLITE_OK) { NSString *sql = [NSString stringWithFormat:@"SELECT * FROM contacts"]; if (sqlite3_prepare_v2( contactDB, [sql UTF8String], -1, &statement, nil) == SQLITE_OK) { while (sqlite3_step(statement) == SQLITE_ROW) { char *field1 = (char *) sqlite3_column_text(statement, 0); NSString *field1Str = [[NSString alloc] initWithUTF8String: field1]; NSLog(@"UserName %@",field1Str); NSData *data = [[NSData alloc] initWithBytes:sqlite3_column_blob(statement, 1) length:sqlite3_column_bytes(statement, 1)]; UIImage *newImage = [[UIImage alloc]initWithData:data]; NSLog(@"Image OBJ %@",newImage); NSLog(@"Image Data %@",data); } sqlite3_close(contactDB); } } sqlite3_finalize(statement); the problem is in log, inserted NSData object and retrieved NSData Objects are different (printing in log gives different stream) moreover Image OBJ is printed null in log.. Have seen similar questions in stackoverflow. But nothing seems to help. Please give some suggestions to overcome this issue.

    Read the article

  • issue with keychain and updates from app store

    - by xonegirlz
    I am having a very frustrating error. I have tested for an app upgrade by first installing the previous version (1.0.1) and then running version (1.0.2). Everything worked fine. I submitted the app and then I am getting issues people are getting crashes when they upgrade. I tried doing the same thing, which is installing the 1.0.1 and then install the binary on the app store, then it crashed. I looked at the console and crash logs and I get this: Jul 7 08:07:45 unknown MyApp[1429] <Warning>: KeychainUtils keychainValueForKey: - Error finding keychain value for key. Status code = -25300 Jul 7 08:07:45 unknown MyApp[1429] <Warning>: AccountSession readUserDataFromDisk - Error finding keychain value for key /var/mobile/Applications/997B32E7-6FFC-4696-9CAA-129BADE2FE64/Documents/instagram_json Jul 7 08:07:45 unknown MyApp[1429] <Warning>: UISegmentedControlStyleBezeled is deprecated. Please use a different style. Jul 7 08:07:45 unknown MyApp[1429] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: username)' *** First throw call stack: (0x33ee688f 0x367e7259 0x33ee6789 0x33ee67ab 0x33e5368b 0x14fd99 0x152319 0x1530bb 0x170299 0x3270ec59 0x32711817 0x354e7dfb 0x354e7cd0) Jul 7 08:07:45 unknown UIKitApplication:com.firesnakelabs.pinstagram[0x14e4][1429] <Notice>: terminate called throwing an exception >

    Read the article

  • Syntax highlighting on iPhone Text-Editor

    - by pbcoder
    Hi, I want to write a simple text editor for iPhone with syntax highlighting support for c,c++. But the problem is, I dont't know how to do this. The first solution I was thinking about, was to go over the text and highlight keywords when the value of the UITextView has changed, but I think that if I got more than 1000lines of code that doesn't work very well. Thanks for help!

    Read the article

  • iphone dev - loading table content asynchronously

    - by Brian
    My app has a navigation controller which push and pop a series of views. One of the tableViews loads .xml file from URL and it takes 4-5 seconds. If I click the back button on the navigation bar, it will only respond after the content of the table finish loading. Is there an easy way to load the content asynchronously so that the app will still respond to my gesture on the navigation bar? p.s. I search this on the Internet and people are talking about multithreading. I don't know a lot about threads so please be more specific. Thanks in advanced =)

    Read the article

  • Objective C: Using UIImage for Stroking

    - by SeongHo
    I am trying to apply a texture for my brush but i'm really having a hard time figuring how it is done. Here's the image of my output. I used an UIImage that just follows the touch on the screen but when i swipe it faster the result is on the right side "W", and on the left side that's the result when i swipe it slow. i tried using the CGContextMoveToPoint and CGContextAddLineToPoint i don't know how apply the texture. Is it possible to use UIImage for the stroke texture? Here's my code UIImage * brushImageTexture = [UIImage imageNamed:@"brushImage.png"]; [brushImagetexture drawAtPoint:CGPointMake(touchCurrentPosition.x, touchVurrentPosition.y) blendMode:blendMode alpha:1.0f];

    Read the article

  • iOS Development: Why isn't my try block catching the exception?

    - by BeachRunnerJoe
    Hi. I have an exception being thrown in my code, but when I wrap it in an try/catch block, it doesn't get caught. The NSLog statement is never called in the catch block. Here's the code... NSInteger quoteLength; [data getBytes:(void *)&quoteLength range:NSMakeRange(sizeof(messageType), sizeof(quoteLength))]; @try { //Debugger stack trace shows an NSException being thrown on this statement NSData *stringData = [data subdataWithRange:NSMakeRange(sizeof(messageType) + sizeof(quoteLength), [data length])]; NSString *quote = [[NSString alloc] initWithData:stringData encoding:NSUTF8StringEncoding]; NSLog(@"received quote: %@",quote); [quote release]; } @catch (NSException * e) { NSLog(@"Exception Raised: %@", [e reason]); } Why doesn't it get caught? Thanks so much!

    Read the article

  • iOS Development: Should the "playersToInvite" property contain an array of strings or an array of GKPlayer objects?

    - by BeachRunnerJoe
    Should the playersToInvite property of the GKMatchRequest object contain an array of NSString objects that hold the player id's or should it contain an array of GKPlayer objects? The documentation on this critical property is not clear at all and I've tried both ways, but my code isn't working, so I can't tell by experimentation. Here's the description for that property in the docs... A list of players to invite to the match. Why did they even bother writing that? Thanks for your help!

    Read the article

  • save sqlite3 file of my App

    - by user1553381
    I'm new with dealing with the .sqlite3 in iphone, I created a sqlite3 file in /Users/myLab/Library/Application Support/iPhone Simulator/5.1/Applications/308C4355-D8EE-4524-A7F9-638DEB68B298/Documents/file.sqlite3 and I inserted the tables into it using Terminal.app and everything works ok with my app. but when I moved this application to another device, opened by xcode and trying to run it, I discovered that my tables are not found in this .sqlite3 file in another device. how can I save my tables in .sqlite3 file??

    Read the article

  • UIButton does not respond to touch events after changing its position using setFrame

    - by Pranathi
    I have a view controller class (child) which extends from view controller class (parent). In the parent class's loadView() method I create a sub-view (named myButtonView) with two buttons (buttons are horizontally laid out in the subview) and add it to the main view. In the subclass I need to shift these two buttons up by 50pixels. So, I am shifting the buttonView by calling the setFrame method. This makes the buttons shift and render properly but they do not respond to touch events after this. Buttons work properly in the views of Parent class type. In the child class type view also, if I comment out the setFrame() call the buttons work properly. How can I shift the buttons and still make them respond to touch events? Any help is appreciated. Following is snippets of the code. In the parent class: - (void)loadView { // Some code... CGRect buttonFrameRect = CGRectMake(0,yOffset+1,screenRect.size.width,KButtonViewHeight); myButtonView = [[UIView alloc]initWithFrame:buttonFrameRect]; myButtonView.backgroundColor = [UIColor clearColor]; [self.view addSubview:myButtonView]; // some code... CGRect nxtButtonRect = CGRectMake(screenRect.size.width - 110, 5, 100, 40); myNxtButton = [UIButton buttonWithType:UIButtonTypeCustom]; [myNxtButton setTitle:@"Submit" forState:UIControlStateNormal]; myNxtButton.frame = nxtButtonRect; myNxtButton.backgroundColor = [UIColor clearColor]; [myNxtButton addTarget:self action:@selector(nextButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; [myButtonView addSubview:myNxtButton]; CGRect backButtonRect = CGRectMake(10, 5, 100, 40); myBackButton = [UIButton buttonWithType:UIButtonTypeCustom]; [myBackButton setTitle:@"Back" forState:UIControlStateNormal]; myBackButton.frame = backButtonRect; myBackButton.backgroundColor = [UIColor clearColor]; [myBackButton addTarget:self action:@selector(backButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; [myButtonView addSubview:myBackButton]; // Some code... } In the child class: - (void)loadView { [super loadView]; //Some code .. CGRect buttonViewRect = myButtonView.frame; buttonViewRect.origin.y = yOffset; // This is basically original yOffset + 50 [myButtonView setFrame:buttonViewRect]; yOffset += KButtonViewHeight; // Add some other view below myButtonView .. }

    Read the article

  • Sorting text and attached images in MFMailCompositeViewController?

    - by eOgas
    In the app I'm currently writing I'd like to populate the message body of an e-mail with a combination of text and images. It took me forever to find out that in order to get an embedded image, you had to have bold tags in the message body (...uhhh, yeah), otherwise the image just shows up as an attachment. But now I have the problem that all of the images just go to the end of the body, and I can't programmatically put text after or in between any of the attachments. So far I've tried: Adding images as part of the body string using tags and a base64 string. This would have worked, but most e-mail clients reject images embedded in this manner. Using normal tags with a references to the attached files, using the assigned filenames. Didn't work at all. Attaching images normally, but also attaching blocks of text to the e-mail. The text is not embedded in the same manner as the images. Turns out to be an attached txt file on the receiving end. Apple has restricted their MFMailComposieViewController class to the point of ridiculousness, but I know there has to be a way to do this, because they add in their stupid "Sent from my *apple device name here*" message at the end of every e-mail. So does anyone have any ideas?

    Read the article

  • Develop an iPhone / iPad Reader app from scratch

    - by Comma
    I'm developing a reader app for viewing and highlighting proprietary format documents. The documents are 2D. (Might add some cool page flip effects) The interface is similar to that of mobile safari. I have no prior experience with iOS development. Could you guys point me to the right direction? (Things I need to consider, tutorials, sample projects...) THX

    Read the article

  • How do I populate an NSMutableArray in one class with another object?

    - by AngeloS
    Hello, I know this is a simple answer, but I can't seem to find the solution. I created an object in its own class and I am trying to populate it with data from another class. For simple data types like NSString, I have no problem, but when trying make an NSMutableArray equal to another NSMutableArray or when I try to populate a NSMutableArray with another objects (like strings), I keep getting exception errors... Here is the object I am trying to populate: #import <Foundation/Foundation.h> @interface RSSFeedList : NSObject { NSString *subject; NSMutableArray *rssfeedDetail; } @property (nonatomic, retain) NSString *subject; @property (nonatomic, retain) NSMutableArray *rssfeedDetail; @end This is how I was able to populate the NSString 'subject' in another class: rssFeedList.subject = @"test"; However, if I follow similar convention within that same class with respect to an Array, it throws an exception: rssFeedList.rssfeedDetail = rssItemDetailArray; Where rssItemDetailArray is a NSMutableArray that I have built in the same class. I have also tried to add items (i tried strings for testing) to the NSMutableArray directly like so to no avail: [rssFeedList.rssfeedDetail addObject:@"test"]; Any ideas?? Thanks in advance!!

    Read the article

  • determine if point on screen is within specific UIScrollView subview

    - by Kyle
    A UIScrollView contains several UIView objects; how can I tell if a point on the screen not generated by touches is within a specific subview of the scrollview? so far atempts to determine if the point is in the subview always return the first subview in the subviews array of the parent scrollview, ie the coordinates are relative to the scrollview, not the window. Here's what I tried (edited) -(UIView *)viewVisibleInScrollView { CGPoint point = CGPointMake(512, 384); for (UIView *myView in theScrollView.subviews) { if(CGRectContainsPoint([myView frame], point)) { NSLog(@"In View"); return myView; } } return nil; }

    Read the article

  • Optional Navigation Controller

    - by Kevin Sylvestre
    I have an application containing a variety of view controllers linked together in different ways (Welcome Browse Preview OR Browse Preview OR Settings Splash). The first view controller is presented modally using a navigation controller from a main controller, then the next set of view controllers are added using pop and push. This works correctly, but I need to be able to define my 'UINavigationBar' and 'UIToolbar' within interface builder, so they still work as expected if they are presented without using a navigation controller. Is this possible? Currently I get this if I try:

    Read the article

  • iPhone Gestures Adding 2 at once

    - by BahaiResearch.com
    Objective C answers are fine too. Currently I am using this code to add 2 gestures (left / right) to my WebView. Works fine. Can I combine this into less code though to indicate that both gestures go to the same action? //LEFT UISwipeGestureRecognizer sgr = new UISwipeGestureRecognizer (); sgr.AddTarget (this, MainViewController.MySelector); sgr.Direction = UISwipeGestureRecognizerDirection.Left; sgr.Delegate = new SwipeRecognizerDelegate (); this.View.AddGestureRecognizer (sgr); //RIGHT UISwipeGestureRecognizer sgrRight = new UISwipeGestureRecognizer (); sgrRight.AddTarget (this, MainViewController.MySelector); sgrRight.Direction = UISwipeGestureRecognizerDirection.Right; sgrRight.Delegate = new SwipeRecognizerDelegate (); this.View.AddGestureRecognizer (sgrRight);

    Read the article

  • iPad App design decision

    - by Comma
    I would like to develop a reader app for viewing and manipulating proprietary format documents. The documents are 2D. (Might add some cool page flip effects) The interface is similar to that of mobile safari. I'm trying to decide whether to write this in Quartz2D or OpenGL ES. I have no prior experience with either of those. Any suggestions?

    Read the article

  • How to perform DNS query on iOS

    - by yasirmturk
    i want to perform some DNS queries e.g. to get IP records against a specific domain name, i am looking for a preferred way or some useful snippet for this on iOS 3.2+ SDK. thanx in advance part from other snippets i found this code Boolean result; CFHostRef hostRef; NSArray *addresses; NSString *hostname = @"apple.com"; hostRef = CFHostCreateWithName(kCFAllocatorDefault, (CFStringRef)hostname); if (hostRef) { result = CFHostStartInfoResolution(hostRef, kCFHostAddresses, NULL); // pass an error instead of NULL here to find out why it failed if (result == TRUE) { addresses = (NSArray*)CFHostGetAddressing(hostRef, &result); } } if (result == TRUE) { [addresses enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { NSString *strDNS = [NSString stringWithUTF8String:inet_ntoa(*((struct in_addr *)obj))]; NSLog(@"Resolved %d->%@", idx, strDNS); }]; } else { NSLog(@"Not resolved"); } but this is producing same IP for every host Resolved 0-220.120.64.1 any help??

    Read the article

  • Adding UIView on top of all views dynamically during runtime?

    - by Easwaramoorthy Kanagaraj
    Team, I am trying to bring a menu in top of all visible views during runtime. This menu should be easily addable and removable dynamically in certain conditions. To do this, I have tried adding a button view to the UIWindow as a subview during runtime. UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:nil forControlEvents:UIControlEventTouchDown]; [button setTitle:@"Show View" forState:UIControlStateNormal]; button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0); [window addSubview:button]; [window makeKeyAndVisible]; [window bringSubviewToFront:button]; But it doesnt worked. Also I have tried to place this button in the root view controller, but no luck again. Edit - Note: This code is not from a UIViewController. I am trying to build a library this will be in that library code. Use case be like you could post NSNotification to enable and disable this menu dynamically during runtime. Please suggest. Thanks !

    Read the article

  • Detect when home button is pressed iOS

    - by nick
    I have several iOS apps that all use the same port to listen for a network beacon. On the main view I use viewWillDisappear to close the port when another view is opened, which was working great. Then I noticed if I pressed the home button from the main view controller without opening another view to close the port, then the port stays open and non of my other apps can listen on that port any more. I then tried using viewWillUnload, but that doesn't seem to get called when I press the home button. -(void)viewWillUnload { //[super viewWillUnload]; NSLog(@"View will unload"); [udpSocket close]; udpSocket = nil; } View will unload is never displayed in the console, which leads me to believe that the method is never getting called. Is there a way to detect when the home button is pressed so I can close my port?

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >