App display error in iOS7 Xcode5 in MKPolyline - ios

I am updating my old app to iOS7. In that app i am displaying line over map using MKPolyline.
its working fine in iOS6 and Xcode 4.6 but doesnt work in my new xcode and displayed error on the codes of MKPolyline.
Is apple has change MapKit Framework. what should i have to update?
On the MKPolyline codes display this error
Unknown type name 'MKPolyline'
But if i Control-Click the MKPolyline than it will take me to the MapKit class.

First of all i think this is the problem with the #import code. You said that this is an old app. please show us the #import code for mapkit framework.
If it like this:
#import "MapKit/MKMapView.h"
than change it to this:
#import <MapKit/MapKit.h>
I think this will solve the unknown class error. if still its display error than use MKGeodesicPolyline instead of MKPolyline. You can find nice explanation here.
Hope it help.

Related

CarbonKit error on iOS7

I have a small problem when use the library "https://github.com/ermalkaleci/CarbonKit" - CarbonKit. The library is excelent, but on iOS7 i have an error because a bug on iOS7 when use auto layout with tableview.
I had made a small sample project to show it:
https://github.com/prsolucoes/CarbonKitError
On project page you will see the error message and the line that generate the problem.
Can anyone help me with it please?
The problem is solved and the solution is on repository.
We cannot use in iOS7 directly on TableView, we need recreate the UITableViewController using UIViewcontroller.
You can see the code on github repository.

JSQMessages.h not found

I added JSQMessageViewController to my project. I went to the bridging header file and added #import <JSQMessages.h>' and I get the errorJSQMessages.h not found'.
Why is Xcode not able to find it?
try #import "JSQMessagesViewController/JSQMessages.h", it might be in a subfolder since the icon in your sidebar is blue.

transitioning to ios8 parse issues

I am moving my app from xcode 5 to xcode 6 (sdk 8.0) and the entire app is crashing from random parse errors.
I have searched stack and other sites for answers, but most are just saying missing an #end or a bracket but with my code I am not noticing it.
Here is an example of some code erroring out below:
#import <UIKit/UIKit.h>
#interface UITabBar (FlatUI)
- (void)configureFlatTabBarWithColor:(UIColor *)color; UI_APPEARANCE_SELECTOR
- (void)configureFlatTabBarWithSelectedColor:(UIColor *)selectedColor; UI_APPEARANCE_SELECTOR
- (void)configureFlatTabBarWithColor:(UIColor *)color
selectedColor:(UIColor *)selectedColor;
#end
Here is a pic of that same code with the IDE errors:
Many other files have the exact same error. Any pointing to the issue would be appreciated. I have just updated to Xcode 6 and have been pulling my hair out.
Thanks

Xcode Adding 3rd Party Code To My Project

Sorry, I'm an Obj-c noob so I'm probably just missing something simple...
I'm trying to add the code in this question to my project. I want to have a simple facebook photo chooser. What does he mean when he says, "And Implement FBImagePickerDelegate delegate with delegate method imagePickingFinishedWithImage: (which is required)."?
Facebook Photo Picker Controller for iOS (similar to the Places Picker controller)
I've added the files to my project but am getting some errors. For one, it doesn't understand FBSession, which was easy to fix by importing the facebook SDK, then however I get another error.
No visible #interface for UIImageView declares the selector 'setImageWithUrl' on this line...
[objCell.imgAlbumCoverPhoto setImageWithURL:urlPhoto];
objCell.imgAlbumCoverPhoto is that a subclass of UIImageView? because UIImageView have no method called setImageWithURL by default. Then you probably havn't imported the headerfile for that class correctly.

iOS MKMapView not displaying map in the simulator

I've just started learning iOS development for iPhone, and following a couple of examples regarding how to display a mapView with the MapKit Framework, I found that google map tiles are not displayed, I only get an empty view (grey tiles), at least in the iPhone simulator (I haven't tried on a device).
I also get this error message:
/SourceCache/GoogleMobileMaps_Sim/GoogleMobileMaps-363.1.2/googlenav/mac/Loader.mm:235
server returned error: 403
I found solutions for similar problem when developing for Android, but not for iOS. Could somebody help me with this issue? Adding the MapKit framework to the project is supposed to be enough to get this working, or maybe am I missing some extra settings that are not mentioned in the tutorials I've followed?
Thanks!
This is the simple sample code I used:
// ViewController.h
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>
#interface ViewController : UIViewController
#property (strong, nonatomic) IBOutlet MKMapView *mapView;
#end
// ViewController.m
#import "ViewController.h"
#implementation ViewController
#synthesize mapView=_mapView;
- (void)viewDidUnload {
[super viewDidUnload];
[self setMapView:nil];
}
... more methods...
And in .xib file, I connected a MKMapView to the file's owner mapView outlet. And at this point, according to the tutorial, I am supposed to be able to see a default US map when running the simulator, but I'm always getting the error I posted before at the debug area, and map view displays only the grey empty grid.
I had the same problem - my UIMapView was only showing the grid, but not the actual map. I quit the simulator and then launched the project again - now it showed the map! It seems like iOS simulator does loses the connection sometimes, even though you might be connected on your computer.
Thank you all for your input!
Have you set the delegate to files owner(self)?
Also have you included mapkit framework and the related header files?
For whatever reason, my iOS simulator sometimes just loses connection to the internet (my computer has connection, but the simulator doesn't recognize it). Once I quit and relaunched my simulator, my maps started showing.
The iOS simulator comes with the official maps app included. Open that and verify that it can get tiles, it could be a network issue. Without any code, outlets, delegates or anything the map should show map data.
An empty map view (grey tiles) as you've described I have seen on the iPhone simulator and a device when trying to specify a map region (see code below for example), however the user has not granted access to their location in app settings. Removing this piece of code when running on the simulator resolved the issue.
MKCoordinateRegion mapRegion;
mapRegion.center = self.mapView.userLocation.coordinate;
mapRegion.span.latitudeDelta = 0.02;
mapRegion.span.longitudeDelta = 0.02;
[self.mapView setRegion:mapRegion animated: YES];
In case anyone looking for the solution. Network issue is solely responsible for this issue. Make sure your simulator has network connection and if it is able to load default apple map, you're good to go.
This issue is a little bit tricky because it involves lots of cases, but for me, it was not loading because of the network monitoring application, eg. Charles, make sure that you have an internet connection and it's unmonitored
I solved this problem by connecting to WIFI with my phone. I didn't have a SIM card installed in my phone, so it just showed the tiles. Just make sure you have network connection.

Resources