这可能是一个n00b的问题,但是......我在我的iPad应用程序中使用Facebook SDK时遇到了一些问题:当我显示一个对话框时,我[facebook dialog:@"feed" andDelegate:self];看不到任何方式我可以更改标题,内容或我要分享的网址.
在他们的演示应用程序中,Facebook有以下代码:
- (IBAction)publishStream:(id)sender {
SBJSON *jsonWriter = [[SBJSON new] autorelease];
NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary
dictionaryWithObjectsAndKeys: @"Always Running",@"text",@"http://itsti.me/",
@"href", nil], nil];
NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
@"a long run", @"name",
@"The Facebook Running app", @"caption",
@"it is fun", @"description",
@"http://itsti.me/", @"href", nil];
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary
dictionaryWithObjectsAndKeys:
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
[_facebook dialog:@"feed"
andParams:params
andDelegate:self];
}
Run Code Online (Sandbox Code Playgroud)
但是,当我按下publishStream按钮时,对话框中没有显示这些字符串!:S
有什么我不对的吗?我在演示应用程序中改变的是Facebook kAppId和URL …
我有一个MPMoviePlayerController从URL加载视频的地方.在iOS 3.2.2中,当我将视频添加到视图中时视频开始下载,但直到我点击播放按钮(这是我想要的)才播放.但是,自iOS 4.2.1问世以来,它开始表现得与众不同; 视频开始下载并自动播放.
这是我加载我的方式MPMoviePlayerController:
MPMoviePlayerController *player = [[MPMoviePlayerController alloc]
initWithContentURL:[NSURL URLWithString:theVideo.fileUrl]];
player.view.frame = articleVideoFrame;
[mainView addSubview:player.view];
Run Code Online (Sandbox Code Playgroud)
我甚至试图[player pause];在addSubview部分后执行,但它仍然会自动播放.你能帮帮我这个吗?
我有以下方法:
- (NSMutableArray *)getElements:(NSString *)theURL;
Run Code Online (Sandbox Code Playgroud)
我想知道是否有办法使用performSelectorOnMainThread调用该方法,以便我可以获得返回值.到目前为止,我尝试过:
myArray = [object performSelectorOnMainThread:@selector(getElements:)
withObject:url waitUntilDone:YES];
Run Code Online (Sandbox Code Playgroud)
但它不起作用,因为performSelectorOnMainThread返回void.我该怎么解决这个问题?
我是一个老学校开发人员(好吧,我20岁,我不是老上学,我只是喜欢打印而不是使用逐步调试器:P)我有很多Log.i ()调用Android应用程序.我想知道它是否会对应用程序的性能产生影响?
我知道我应该使用逐步调试器,只是调试多个线程可能有点麻烦.
谢谢你的帮助!
我觉得这很简单,但对于我的生活,我无法改变subclipse中的svn:externals属性!我把它设置为:
wp http://core.svn.wordpress.org/branches/3.0
Run Code Online (Sandbox Code Playgroud)
并希望将其设置为:
wp http://core.svn.wordpress.org/branches/3.1
Run Code Online (Sandbox Code Playgroud)
如果我进入'team-> set property'对话框,它会说"另一个属性具有相同的名称",它不会让我改变它.
我能做什么?谢谢你的帮助!
有没有办法从项目中撤消get-latest-version?我已经在一个项目上工作了一个星期,从未检查过我正在处理的文件.一位同事不得不从我的计算机上传一个版本,所以他在整个解决方案中使用了get-latest-version(递归)命令.
我的Visual Studio似乎有问题,它允许编辑而不检查文件,所以我的所有编辑都没有检查文件.当Vs提示我的同事检查保留更改或用SourceSafe替换本地版本时,他选择用SourceSafe的版本替换本地版本,并且配置我的VS以便它将该设置应用于每个文件.
所以,我刚刚失去了本周的工作.有没有办法还原这个?
所以我是这个iPad业务的新手,我正在基于XML文件的内容以编程方式在scrollview中创建一些按钮.我有这个代码:
float x = (SLIDER_ELEMENT_HEIGHT * i) + 20;
CGRect frame = CGRectMake(x, 0, SLIDER_ELEMENT_WIDTH, SLIDER_ELEMENT_HEIGHT);
UIButton *button = [[UIButton alloc] initWithFrame:frame];
UIColor *bgColor = [[UIColor alloc] initWithRed:1.0 green:1.0 blue:1.0 alpha:1.0];
button.backgroundColor = bgColor;
NSString *titleForButton = [NSString stringWithFormat: @"This is my title"];
[button setTitle:titleForButton forState:(UIControlStateNormal | UIControlStateApplication | UIControlStateHighlighted)];
UIColor *fgColor = [[UIColor alloc] initWithRed:0.5 green:0.5 blue:0.5 alpha:1.0];
[button setTitleColor:fgColor forState:(UIControlStateNormal | UIControlStateApplication | UIControlStateHighlighted)];
[button addTarget:self action:@selector(buttonMethod:) forControlEvents:(UIControlEvents)UIControlEventTouchDown];
[scrl_lastIssues addSubview:button];
Run Code Online (Sandbox Code Playgroud)
现在,我追加的方法监听器工作正常,但按钮的文本从未出现......我做错了什么?
谢谢你的帮助!