Popovers cannot be presented from a view which does not have a window

the thing that saved my life: if (self.view.window != nil) [popoverController presentPopoverFromRect:CGRectMake(44, yCoord, 111, 111) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; by adding if condition it doesn´t crash anymore. I don´t really get it because the presentPopoverFromRect function is ALWAYS called. There is no situation where window would be nil but anyway it did the trick. edit: I … Read more

iPad/iPhone browser crashing when loading images in Javascript

Update: I think there’s an even easier way to do this, depending on your application. Instead of having multiple images, if you simply have one <img> element or Image object (or maybe two, like a ‘this’ image and a ‘next’ image if you need animations or transitions) and simply update the .src, .width, .height and … Read more

Get Exif data from UIImage – UIImagePickerController [duplicate]

Interesting question! I came up with the following solution working for images picked from your photo library (note my code is using ARC): Import AssetsLibrary.framework and ImageIO.framework. Then include the needed classes inside your .h-file: #import <AssetsLibrary/ALAsset.h> #import <AssetsLibrary/ALAssetRepresentation.h> #import <ImageIO/CGImageSource.h> #import <ImageIO/CGImageProperties.h> And put this inside your imagePickerController:didFinishPickingMediaWithInfo: delegate method: ALAssetsLibrary *library = [[ALAssetsLibrary … Read more

Iphone SDK dismissing Modal ViewControllers on ipad by clicking outside of it

I’m a year late, but this is pretty straightforward to do. Have your modal view controller attach a gesture recognizer to the view’s window: UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapBehind:)]; [recognizer setNumberOfTapsRequired:1]; recognizer.cancelsTouchesInView = NO; //So the user can still interact with controls in the modal view [self.view.window addGestureRecognizer:recognizer]; [recognizer release]; The handling code: … Read more

Get PDF hyperlinks on iOS with Quartz

heres the basic idea to get to the annots CGPDFDictionary for each page atleast. after that you should be able to figure it out with help from the PDF spec from Adobe. 1.) get the CGPDFDocumentRef. 2.) get each page. 3.) on each page, use CGPDFDictionaryGetArray(pageDictionary, “Annots”, &outputArray) where pageDictionary is the CGPDFDictionary representing the … Read more

How to share keychain data between iOS applications

After some (a lot of) digging throughout the web, I found the answer. The access Group that you use when constructing your KeychainItemWrapper class must ALSO be specified in each of your application’s Entitlements.plist file in the “keychain-access-groups” section. It seems almost obvious now that I see “keychain-access-groups“. However, I had no idea to even … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)