小编Kas*_*sem的帖子

Facebook loginViewFetchedUserInfo被调用两次

我在我的应用程序中使用facebook SDK 3.0.登录到Facebook后,委托方法被调用两次.

- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
                            user:(id<FBGraphUser>)user {
    //loginThroughFb=TRUE;
    NSString *userId=[[NSString alloc] initWithString:[user id]];
    [self soapCallForLogin:@"" password:@"" deviceId:@"" fbid:userId];
    NSLog(@"%@",userId);
    [userId release];

}
Run Code Online (Sandbox Code Playgroud)

iphone facebook-graph-api ios facebook-ios-sdk

16
推荐指数
3
解决办法
6009
查看次数

自定义MKAnnotationView与框架,图标和图像

我一直在寻找类似于如何设计像这样的自定义MKAnnotationView的解决方案.

在此输入图像描述

我是MKAnnotation的子类,我能够添加一个名为F.png的图像,F.png是一个帧图像,如图所示.我想要的是添加内部图像.(我绘制的图片中的蓝色)

- (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation
{    
if ([annotation isKindOfClass:[MKUserLocation class]])
    return nil;
static NSString* AnnotationIdentifier = @"AnnotationIdentifier";
MKAnnotationView *annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationIdentifier];
if(annotationView)
    return annotationView;
else
{
    MKAnnotationView *annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier];
    annotationView.canShowCallout = YES;
    annotationView.image = [UIImage imageNamed:[NSString stringWithFormat:@"F.png"]];        
    UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
    [rightButton addTarget:self action:@selector(writeSomething:) forControlEvents:UIControlEventTouchUpInside];
    [rightButton setTitle:annotation.title forState:UIControlStateNormal];

    annotationView.rightCalloutAccessoryView = rightButton;
    annotationView.canShowCallout = YES;
    annotationView.draggable = NO;
    return annotationView;
}
return nil;
}
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch objective-c ios ios5

12
推荐指数
1
解决办法
1万
查看次数

在另一个UIImage上添加UIImage

我有2张图片:第一张是用户个人图片,第二张是图标(徽章).

我想在第一个uiimage(用户的图像)的左下角添加第二个uiimage(图标)并将它们保存到新的Uiimage中.

谢谢

objective-c uiimage ios

10
推荐指数
1
解决办法
9326
查看次数

隐藏所有模态视图控制器

我有一个作为ModelViewController呈现的登录视图,我有一个注册视图,在其上面显示为NavigationControlloer:

登录(ModelViewController)---->注册(NavigationController)

我在Loginview上展示了Register视图(CreateAccount),如下所示:

createAccount= [[CreateAccount alloc] initWithNibName:@"CreateAccount" bundle:nil];

navController = [[UINavigationController alloc] initWithRootViewController:createAccount];

UIBarButtonItem *cancelButtun=[[UIBarButtonItem alloc]initWithTitle:@"Cancel" style:UIBarButtonItemStyleBordered target:self action:@selector(HideMe)];

UIBarButtonItem *registerButtun=[[UIBarButtonItem alloc]initWithTitle:@"Register" style:UIBarButtonItemStyleBordered target:self action:@selector(Register)];

createAccount.navigationItem.leftBarButtonItem = cancelButtun;
createAccount.navigationItem.rightBarButtonItem=registerButtun;
createAccount.title=@"Create Account";

[self presentModalViewController:navController animated:YES];
Run Code Online (Sandbox Code Playgroud)

登录控制器具有NSURLConnectionDelegate用于booth登录和注册.注册完成后我只需拨打电话

[self dismissModalViewControllerAnimated:YES];
Run Code Online (Sandbox Code Playgroud)

这将仅取消注册视图.

我想解雇登录视图,所以我可以回到我的主应用程序.

iphone cocoa-touch objective-c modalviewcontroller ios

9
推荐指数
2
解决办法
1万
查看次数

位置管理器是在调度队列上创建的

这条消息是什么意思?

注意,在主线程以外的线程上执行的调度队列上创建了位置管理器(0xe86bdf0).开发人员有责任确保在分配了位置管理器对象的线程上运行运行循环.特别是,不支持在任意调度队列(未附加到主队列)中创建位置管理器,这将导致无法接收回调.

iphone objective-c ios ios5

8
推荐指数
2
解决办法
6569
查看次数

java中如何实现多线程广度优先搜索?

我已经以正常方式完成了广度优先搜索。现在我正在尝试以多线程的方式做到这一点。我有一个在线程之间共享的队列。当我从队列(FIFI队列)中删除节点时,我使用synchronize(LockObject),所以我想做的是。当我的线程找到解决方案时,所有其他线程将立即停止。

java multithreading artificial-intelligence breadth-first-search

6
推荐指数
1
解决办法
8421
查看次数

如何检测是否隐藏了删除按钮UItableviewcell?

我有一个包含UITableView的视图.当用户滑动时,我能够在单元格上显示删除按钮.

如果用户触摸删除按钮,将触发一个方法(这很好).但是,如果用户决定不删除单元格,并且他触摸视图中的任何位置以隐藏删除按钮.

我怎么能检测出来?

iphone cocoa-touch objective-c ios ios5

5
推荐指数
1
解决办法
3008
查看次数

SQL选择不同的列

我有一个返回以下数据的查询

在此输入图像描述

正如您在图像中看到的那样,关于列"A"的彩色组是相似的,我想在第一次出现这些行时关于列"A"并丢弃其余部分.

所以我最终可以得到这个结果.

在此输入图像描述

任何解决方案

谢谢 :)

更新:

这是原始查询结果 在此输入图像描述

sql stored-procedures sql-server-2008

5
推荐指数
1
解决办法
149
查看次数

从didExitRegion获得准确的坐标

我正在实施一个应用程序,我需要通过以下方式跟踪用户的位置:

  • 在应用处于后台或关闭时跟踪用户的位置
  • 如果用户的位置改变了大约2000米,我应该执行API调用.

我解决这个问题的方法如下:

  • 用户第一次启动应用程序时,我会使用其当前位置开始监控某个区域
  • 如果触发了didExitRegion,我执行API调用并使用当前位置作为新区域的中心,用新区域替换当前监视区域.

当应用程序位于前台时,这可以正常工作,因为从位置管理器返回的位置是准确的.

但是如果应用程序在后台,那么位置管理器将不会返回准确的位置,因为它是第一次运行并且返回的第一个坐标不准确.

问题是如何在后台触发didExitRegion时获得用户的准确位置?

谢谢

iphone objective-c cllocationmanager ios5

5
推荐指数
1
解决办法
524
查看次数

使用TWRequest进行Twitter更新会产生403错误

我正在使用以下代码使用iOS 5 twitter API在用户的时间轴上发推文

//创建一个帐户商店对象.ACAccountStore*accountStore = [[ACAccountStore alloc] init];

// Create an account type that ensures Twitter accounts are retrieved.
ACAccountType *accountType =  [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];

// Request access from the user to use their Twitter accounts.
[accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) 
 {
     if(granted) 
     {
         // Get the list of Twitter accounts.
         NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];

         // For the sake of brevity, we'll assume there is only one Twitter account present.
         // You would ideally ask the user which …
Run Code Online (Sandbox Code Playgroud)

iphone twitter objective-c ios ios6

4
推荐指数
2
解决办法
1975
查看次数

如何在Objective-C中实现多级委托

我有4个班级(观点):
A,B,C和D.

A类呼叫B,B呼叫C,C呼叫D:
A> B> C> D.

在类DI中已经实现了委托协议,我想在A类中捕获委托事件.

我怎样才能做到这一点?

iphone objective-c ios ios5

3
推荐指数
1
解决办法
541
查看次数

查询Parse SDK加入两个类

我在iOS应用程序中使用Parse.com.

我有两节课

  • 用户
  • 岗位

用户有一个名为'blocked'的布尔标志.

我想检索所有非阻止用户的帖子(其中被阻止= 0)

我怎样才能做到这一点?

iphone ios parse-platform

2
推荐指数
1
解决办法
1983
查看次数

在选项卡控制器视图之前显示登录屏幕

我有一个tabBarController应用程序和使用.xib文件的接口而不是故事板我默认在appdelegate中有这个代码

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
UIViewController *viewController1 = [[PopAdsFirstViewController alloc] initWithNibName:@"PopAdsFirstViewController" bundle:nil];

UIViewController *viewController2 = [[PopAdsSecondViewController alloc] initWithNibName:@"PopAdsSecondViewController" bundle:nil];

self.tabBarController = [[UITabBarController alloc] init];

self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];

self.window.rootViewController = self.tabBarController;

[self.window makeKeyAndVisible];

return YES;
Run Code Online (Sandbox Code Playgroud)

我创建了一个登录视图,不知道如何在tabBarView之前显示它并在成功登录后隐藏t.

iphone xcode objective-c ios

1
推荐指数
2
解决办法
4956
查看次数