I'm implementing Skobbler SDK (v2.5) but I've an issue with firsts steps.
App crashes with this error:
[SKVectorMapView displayTrafficWithMode:]: unrecognized selector sent to instance
This is the code of AppDelegate
SKMapsInitSettings* initSettings = [[SKMapsInitSettings alloc]init];
initSettings.mapDetailLevel = SKMapDetailLevelLight;
[[SKMapsService sharedInstance] initializeSKMapsWithAPIKey:API_KEY settings:initSettings];
And this is the ViewController's code:
- (void)viewDidLoad {
[super viewDidLoad];
SKMapView *mapView = [[SKMapView alloc] initWithFrame:CGRectMake( 0.0f, 0.0f, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) )];
[self.view addSubview:mapView];
}
Could you tell me what is wrong?
Make sure you added "-ObjC" to your "other linker flag".
"Select the project and choose your target. Choose the Build settings tab and in the Other linker flags option introduce -ObjC."
from developer.skobbler.com
Related
I can't see the MPMoviePlayerController controls when I'm streaming only audio, is this normal? All i can see is a black screen, though the audio is playing, however it works when playing video in another view. I hoped this would allow me to use the controls so i didn't have to build my own UI with AVPlayer.
My code is as follow;
self.audioPlayer = [[MPMoviePlayerController alloc] init];
self.audioPlayer.movieSourceType = MPMovieSourceTypeStreaming;
[self.audioPlayer setContentURL:self.audioUrl];
[self.audioPlayer setControlStyle:MPMovieControlModeDefault];
self.audioPlayer.scalingMode = MPMovieScalingModeAspectFit;
[self.audioPlayer.view setFrame:self.view.bounds];
[self.view addSubview:self.audioPlayer.view];
[self.view bringSubviewToFront:self.audioPlayer.view];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:#selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:self.audioPlayer];
[self.audioPlayer prepareToPlay];
[self.audioPlayer play];
Regards
In the end i built an AVPlayer with UI rather than use MPmovieplayer.
I'm trying to integrate MFSideMenu in my project but I don't want to adopt the approach described in the GitHub depository as it defines the menu in the app delegate.
I have a login screen which will introduce a navigation controller with the main page as reported in this picture
I would like to add the support for MFSideMenu in the navigationcontroller root controller using this code:
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
// Custom initialization
self.sideMenuController = [[SideMenuViewController alloc] init];
UINavigationController *navigationController = self.navigationController;
MFSideMenuOptions options = MFSideMenuOptionMenuButtonEnabled|MFSideMenuOptionBackButtonEnabled
|MFSideMenuOptionShadowEnabled;
MFSideMenuPanMode panMode = MFSideMenuPanModeNavigationBar|MFSideMenuPanModeNavigationController;
MFSideMenu *sideMenu = [MFSideMenu menuWithNavigationController:navigationController
sideMenuController:sideMenuController
location:MFSideMenuLocationLeft
options:options
panMode:panMode];
sideMenuController.sideMenu = sideMenu;
}
return self;
}
When I run the app the menu button appears in my navigation bar and everything seems working fine but,if I introduce the navigation controller through a modal segue (i.e. a login screen which goes to the navigation controller in case of a correct login) the button disappears.
Any idea about how to fix it?
[urlDict setObject:urlStr forKey:#"url"];
[urlArray addObject:urlDict];
//here in urlArray i got bellow url,
http://example.com/somevidya.AVI
How to play this url in iphone application?
You can add the url to a MPMoviePlayerController like this.
MPMoviePlayerController *videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
then present it modally like so:
[[UIApplication sharedApplication].keyWindow.rootViewController presentModalViewController:video animated:YES];
and release the videoPlayer:
[videoPlayer release];
in my code I call tab bar controller like this:
[[TTNavigator navigator] openURLAction:[TTURLAction actionWithURLPath:#"tt://tabBar"]];
For the first page which tab bar called like this:
- (id)init{
if (self = [super init]) {
self.title = #"app";
UIImage* image = [UIImage imageNamed:#"tab.png"];
self.tabBarItem = [[[UITabBarItem alloc] initWithTitle:self.title image:image tag:0] autorelease];
self.variableHeightRows = YES;
id<TTTableViewDataSource> ds = [MainPageDataSource dataSourceWithItems:nil];
ds.model = CreateTabModelWithCurrentSettings();
self.dataSource = ds;
}
return self;}
-(void)loadView{
self.view = [[[UIView alloc] initWithFrame:TTApplicationFrame()] autorelease];
self.tableView = [[[UITableView alloc] initWithFrame:TTApplicationFrame() style:UITableViewStylePlain] autorelease];
self.tableView.rowHeight = 80.f;
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:self.tableView];}
As shown above.
how to remove the "back" title?
how to remove both of title?
Actually I found that the back navigate bar is previous login page's, so is there any way to release the previous login page after the tab bar controller has been called
Take a look on this tutorial. It explains how to hide the tab bar when you push a login view.
http://three20.info/article/2010-11-10-Hiding-The-iphone-Tab-Bar-With-TTNavigator
Note that it makes more sense to show your tab bar main controller, and push the login view in case the user isn't logged in. This way you can release the login view and come back to the main tab bar view.
Also, if you have issues with duplicated UINavigationBar bars, you should use the [TTURLMap from:(NSString*)URL toModalViewController:(id)target] function, which present controllers that already has UINavigationBar
`
//Move to bookmarked place if page is opened from bookmark section.
- (void)webViewDidFinishLoad:(UIWebView *)webView1;
{
if(chkview == 2)
{
//Move webview to chkScrollValue position.
[webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:#"document.body.scrollTop = %d", chkScrollValue]];
// [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:#"window.scrollBy(0,%d);",chkScrollValue]];
}
}
I'm loading my webview which was displaying html which was in resources folder and it was working fine. Now, i'm using javascript with html and this is not working anymore.
I got the solution. I was performing this task after webViewDidFinishLoad. Rather than that now I added another function and added this code in function
[self performSelector:#selector(loadBookmark) withObject:nil afterDelay:0.4];