我刚刚Xcode 4.5GM在我的iPhone项目中升级并整理了一些屏幕,以应对iPhone 5上的额外屏幕尺寸.该项目是针对性的iOS 5.1,我刚刚为我的手机构建它,我收到此链接器错误:
文件是通用的(2个切片)但不包含(n)armv7s切片:/Users/JonathanW/Documents/MyXcode/myApp/myApp/CorePlot/libCorePlot-CocoaTouch.a用于架构armv7s
我Core Plot 1.0在我的项目中使用静态库,直到现在还没有任何问题.环顾四周,我可以看到与构建体系结构设置类似的错误,但不知道从何处开始.该项目在模拟器(包括正常工作iOS 5.1和iOS 6).有任何想法吗?
我用来UIWebView从a加载web webLink并UIWebViewDelegate控制错误状态:
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:webLink]]];
- (void)webViewDidStartLoad:(UIWebView *)webView{
NSLog(@"START LOAD");
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
NSLog(@"FINISH LOAD");
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
NSLog(@"ERROR : %@",error);
}
Run Code Online (Sandbox Code Playgroud)
但是,当webLink没有找到,它不会去didFailLoadWithError,它去startLoad和didFinishLoad.如何webLink找到未找到的情况?请帮忙!
我一直在Google图表游戏中玩谷歌图表:
我一直在玩的代码是这样的:
function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Year', 'Austria'],
['2003', 1336060],
['2004', 1538156],
['2005', 1576579],
['2006', 1600652],
['2007', 1968113],
['2008', 1901067]
]);
// Create and draw the visualization.
new google.visualization.BarChart(document.getElementById('visualization')).
draw(data,
{title:"Yearly Coffee Consumption by Country",
width:600, height:400,
vAxis: {title: "Year"},
hAxis: {title: "Cups"}}
);
}
Run Code Online (Sandbox Code Playgroud)
这给了我一个很好的图表,看起来像这样:

我试图让这个图表符合我的网站的需要,为此,我需要在左边的链接到另一个页面.因此,例如,2003年将是用户可以单击ans的链接,因此2004年等.
我试着这样做:
function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Year', 'Austria'],
['<a href="url">Link text</a>', 1336060],
['2004', …Run Code Online (Sandbox Code Playgroud) 我需要在整个应用程序中维护我的登录凭据,因此,我有3个选项来维护我的登录凭据...
1 key chain
2 NSUserDefaults
3 plist
Run Code Online (Sandbox Code Playgroud)
哪一个最好选择?是否有其他方式来存储登录凭据?
提前致谢
我在简单的条形图应用程序,使用Coreplot开发此应用程序,然后我尝试实现条形图,但我得到的问题发现在
[__NSCFConstantString sizeWithTextStyle:]: unrecognized selector sent to instance 0x7fb4c'
First throw call stack:
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题?请帮我
提前致谢
我试过这个:
Viewcontroller.h
#import <UIKit/UIKit.h>
#import "CorePlot-CocoaTouch.h"
@interface GraphViewController : UIViewController <CPTPlotDataSource>
{
CPTXYGraph *barChart;
NSTimer *timer;
NSMutableArray *samples;
}
-(void) getGraphValues;
@end
Run Code Online (Sandbox Code Playgroud)
Viewcontroller.m
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor=[UIColor whiteColor];
self.title = @"Sample";
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
[self.navigationController setNavigationBarHidden:NO];
[self getGraphValues];
double xAxisLength = [samples count];
barChart = [[CPTXYGraph alloc] initWithFrame:CGRectMake(0, 0, 320, 380)];
barChart.plotAreaFrame.borderLineStyle = nil;
barChart.plotAreaFrame.cornerRadius = 0.0f;
barChart.paddingLeft = 0.0f;
barChart.paddingRight …Run Code Online (Sandbox Code Playgroud) 我正面临着问题"MyViewcontroller使用带有loadHTMLString baseURL方法的NULL baseURL参数:数据定理" - 我已经成功完成了我的任务并且一切正常.
该问题是在OSWAP安全扫描中针对漏洞显示上述错误.
我的代码片段: -
NSString *aHtmlString = kEmptyString;
// Getting the bool from configuration plist
NSString *thePlistPath = [[NSBundle mainBundle] pathForResource:@"config" ofType:@"plist"];
NSDictionary *theURLdata = [[NSDictionary alloc] initWithContentsOfFile:thePlistPath];
is
ServerFAQAvailable = [[theURLdata valueForKey:kIsServerFAQAvailableKey] boolValue];
if (one || two || three) {
aHtmlString = [self loadFAQFor];
} else {
aHtmlString = [self loadFAQForwithout];
}
NSURL *baseURL = [NSURL fileURLWithPath:thePlistPath];
[self.faqWebView loadHTMLString:aHtmlString baseURL:baseURL];
Run Code Online (Sandbox Code Playgroud)
更新:
if (one || two || three) {
aHtmlString = [self loadFAQFor];
} else { …Run Code Online (Sandbox Code Playgroud) 我想iOS通过使用在我的应用程序中创建类似的按钮
curl -X POST \
-F 'access_token=USER_ACCESS_TOKEN' \
-F 'object=OG_OBJECT_URL' \
https://graph.facebook.com/[User FB ID]/og
Run Code Online (Sandbox Code Playgroud)
由...给出的Open graph api.
为此,我发了邮件请求即
NSString *stringurl=[NSString stringWithFormat:@"{access_token=AAAE08AxGmwghghghOWAxMZBz6jZAaRTUYTRMakJln3VdAeUju6E6tFn2I9feY5wtGatTm2KIgXoXYFZB0pTPQt2Oj0sNaRuX3AZDZD}&{object=http://www.google.com}&https://graph.facebook.com/100002097766610/og.likes"];
NSURL *url = [NSURL URLWithString: stringurl];
NSMutableURLRequest *request1 = [NSMutableURLRequest requestWithURL:url];
[request1 setURL:url];
[request1 setHTTPMethod:@"POST"];
[request1 setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSError *error;
NSURLResponse *response;
NSData *data = [NSURLConnection sendSynchronousRequest:request1 returningResponse:&response error:&error];
NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"string..:%@",string);
Run Code Online (Sandbox Code Playgroud)
但我得到空字符串.可能是我正在制作错误的url字符串.如果有人知道如何发出curl post请求.请给我一些想法.
谢谢大家.
我正在使用asp.net mvc 4. 在这里,我想使用自动完成扩展器,使用JQuery我想填充CityID会话中存储的所有位置的位置。
这是创建会话的函数:
public string Create(string City)
{
try
{
//HttpSessionStateBase Session["c"]=City;
//HttpContext.Current.Session["City"] = City;
System.Web.HttpContext.Current.Session["City"] = City;
long CityID = Convert.ToInt64(System.Web.HttpContext.Current.Session["City"].ToString());
return City;
}
catch (Exception ex)
{
throw (ex);
}
}
Run Code Online (Sandbox Code Playgroud)
当用户从 City 中选择任何城市时调用此函数dropdownlist。
我JQuery对自动完成扩展程序的要求是:
<script type="text/javascript">
var url = '@Url.RouteUrl("DefaultApi", new { httproute = "", controller = "ProductApi" })';
$('#txtLocation').autocomplete({
source: function (request, response) {
alert(url);
$.ajax({
url: url,
data: { query: request.term },
dataType: …Run Code Online (Sandbox Code Playgroud) 我得到的是一个NSNumber在a 中创建AppDelegate并保存a numberWithBool:TRUE和a ViewController的对象.
我的问题是,ViewController无法识别我NSNumber的设置为1.调试器证明它NSNumber确实设置为1但没有发生任何事情.
if([appDelegate.gotUrl isEqualToNumber:[NSNumber numberWithBool:TRUE]])
{
//will do nothing
}
Run Code Online (Sandbox Code Playgroud)
我的问题的解决方案?
提前致谢
我UIAlertView在课堂上的代表团遇到了困难ViewController.一切都很好,直到用户点击OK按钮 - 然后应用程序崩溃
Thread 1: EXC_BAD_ACCESS (code=2, address 0x8)
Run Code Online (Sandbox Code Playgroud)
ViewController.h:
#import <UIKit/UIKit.h>
#import "DataModel.h"
@interface ViewController : UIViewController
@end
Run Code Online (Sandbox Code Playgroud)
ViewController.m:
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
DataModel *dataModel = [[DataModel alloc] init];
[dataModel ShowMeAlert];
[super viewDidLoad];
}
@end
Run Code Online (Sandbox Code Playgroud)
DataModel.h
#import <Foundation/Foundation.h>
@interface DataModel : NSObject <UIAlertViewDelegate>
- (void)ShowMeAlert;
@end
Run Code Online (Sandbox Code Playgroud)
DataModel.m
#import "DataModel.h"
@implementation DataModel
- (void)ShowMeAlert;
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Info" message:@"View did load!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; …Run Code Online (Sandbox Code Playgroud) ios ×6
iphone ×6
objective-c ×6
core-plot ×2
uiwebview ×2
asp.net ×1
asp.net-mvc ×1
bar-chart ×1
c# ×1
credentials ×1
curl ×1
delegates ×1
javascript ×1
jquery ×1
linker ×1
nsnumber ×1
nsobject ×1
security ×1
uialertview ×1
web ×1
xcode ×1