问题 - 我想要一个包含标题的UIAlertView,两个带占位符的文本字段和两个按钮. 我到目前为止做了什么 - 我已经使用了这段代码,我得到的确切的UIAlertView与我提到的所有这些,但是当视图加载时似乎首先出现在底部,然后进入视图的中间.
-(void)showalert{
disclaimerAgreedAlertView = [[UIAlertView alloc] initWithTitle:@" "
message:@" "
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Login", nil];
userNameTextField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 15.0, 245.0, 25.0)];
userNameTextField.delegate=self;
[userNameTextField setBackgroundColor:[UIColor whiteColor]];
[userNameTextField setKeyboardType:UIKeyboardTypeDefault];
userNameTextField.placeholder=@"Username";
userNameTextField.secureTextEntry=NO;
[disclaimerAgreedAlertView addSubview:userNameTextField];
passwordTextField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)];
passwordTextField.delegate=self;
[passwordTextField setBackgroundColor:[UIColor whiteColor]];
[passwordTextField setKeyboardType:UIKeyboardTypeDefault];
passwordTextField.placeholder=@"Password";
passwordTextField.secureTextEntry=YES;
[disclaimerAgreedAlertView addSubview:passwordTextField];
disclaimerAgreedAlertView.tag=99;
[disclaimerAgreedAlertView show];
disclaimerAgreedAlertView.frame= CGRectMake(5, 400, 320, 160);
}
Run Code Online (Sandbox Code Playgroud)
然后我尝试了一些未记录的api,它们给了我想要的结果,但我担心它可能会导致我的应用程序被拒绝.
那么,任何解决方案呢?
我正在尝试将数据发送到服务器并获得响应.数据到达服务器但我没有得到任何响应.响应数据的值是nil bcd,它正在抛出异常,
-JSONValue failed. Error trace is: (
"Error Domain=org.brautaset.JSON.ErrorDomain Code=11 \"Unexpected end of string\" UserInfo=0x4e2dd70 {NSLocalizedDescription=Unexpected end of string}"
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助我....
我的代码:
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://192.168.0.83:8082/WebServiceProject/AcessWebservice?operation=login"]];
[[NSURLConnection alloc] initWithRequest:request delegate:self];
NSURLResponse *theResponse =[[NSURLResponse alloc]init];
NSError *theError = NULL;
NSArray *keys = [NSArray arrayWithObjects:@"UserId", @"Password", nil];
NSArray *objects = [NSArray arrayWithObjects:@"rajin.sasi", @"abhi1551", nil];
NSDictionary *jsonDictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys];
NSString* jsonString = [jsonDictionary JSONRepresentation];
SBJSON *jsonParser = [SBJSON new];
[jsonParser objectWithString:jsonString];
NSLog(@"Val of json parse obj is %@",jsonString);
[request …Run Code Online (Sandbox Code Playgroud) Apple Developer's网站中Team Agents和Admins有什么区别?任何不同的权利?
我已经尝试了推送通知我的应用程序开发,它工作正常.当我生成生产(分发)的.p12文件时,它正在创建.在服务器上部署.pem文件后,它正在抛出并出错.
OpenSSL :: SSL :: SSLError(SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器激励票A:sslv3警报证书未知):"}
服务器:RoR(Ruby on Rails) 任何帮助都会非常明显.
注意:对于开发.p12,它工作正常.问题是我正在部署分发.p12.请建议我可能遗漏的内容.
感谢致敬
iphone ruby-on-rails push-notification apple-push-notifications ios
我有一个TimeTracker的应用程序.我想添加一个用于显示报告的日历.据我所知,XCode/iOS不提供任何日历工具(如日期选择器).我应该使用什么?
谢谢
编辑:感谢快速响应的人(Mayur,John和Yoko).当每个人的回答几乎相同时,接受一个答案真的很难.
关心Akshay
可能重复:
从我的应用程序拨打iphone电话
我想从我的iPhone应用程序拨打给定号码的电话.你能建议一个最好解释它的好教程或告诉我这个过程吗?
可能重复:
编程接收信号:"0".数据格式化程序暂时不可用
我在XiB上取200个OBShapedButtons并在那里设置背景图像.之后,我将拍摄特定OBShapedButton的图像,并将图像着色并再次将其设置为OBShapedButton的背景.
-(void)onTick:(NSTimer *)timer {
//Database
UIImage *setColor=[[UIImage alloc] init];
for (int i=0; i<[dataArray count]; i++)
{ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
currentLevelMaleValue =[[[dataArray objectAtIndex:i] objectForKey:@"CurrentLevelMaleColor"] doubleValue];
printf("Current val is %f",currentLevelMaleValue);
for (OBShapedButton *obshapedCountryButtons in scrollBaseView.subviews)
{
if (obshapedCountryButtons.tag==i+1)
{
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapButton:)];
tap.numberOfTouchesRequired=1;
tap.numberOfTapsRequired=1;
[obshapedCountryButtons addGestureRecognizer:tap];
[obshapedCountryButtons addTarget:self action:@selector(buttonTagTrap:) forControlEvents:UIControlEventTouchDown];
//[obshapedCountryButtons addTarget:self action:@selector(tapButton:) forControlEvents:UIControlStateHighlighted];
setColor=[obshapedCountryButtons imageForState:UIControlStateNormal];
countryCode =[self getCountryColorCurrentLevel:currentLevelMaleValue];
setColor =[setColor imageTintedWithColor:countryCode];
[obshapedCountryButtons setImage:setColor forState:UIControlStateNormal];[pool release];
// [setColor release];
// [obshapedCountryButtons release]; …Run Code Online (Sandbox Code Playgroud) 一旦有人通过我的应用程序登录到facebook,我怎样才能获得用户名?
我正在使用: - FBConnect API.
我的Controller.m文件 -
#import "FacebookPOCViewController.h"
@implementation FacebookPOCViewController
@synthesize session = _session;
@synthesize logoutButton = _logoutButton;
@synthesize loginDialog = _loginDialog;
@synthesize facebookName = _facebookName;
- (void)viewDidLoad {
//PayTai Facebook App
static NSString* kApiKey = @"230600000000";
static NSString* kApiSecret = @"----------------------";
_session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain];
// Load a previous session from disk if available. Note this will call session:didLogin if a valid session exists.
[_session resume];
[super viewDidLoad];
}
- (IBAction)loginTapped:(id)sender {
//_posting = YES; …Run Code Online (Sandbox Code Playgroud) 我的.xib中有一个按钮和一个UIImageView.我已经检查了Interface Builder中的"隐藏"值.现在我想在点击按钮上显示图像.怎么做 ?
谢谢
如何在图像上显示文本?
说明:"我正在开发一个应用程序,它需要在图像上显示文本,并在将文本放入某些帧后将文本显示在另一个视图中."
编辑:从这里我得到一些值和".png",但我得到的字符就像ASCII值或其他东西.
UIImage*img=[UIImage imageNamed:@"btn_reset.png"];
NSData *dataObj = UIImagePNGRepresentation(img);
NSString*str= [[NSString alloc] initWithData:dataObj encoding:NSASCIIStringEncoding];
printf("Image is %s",[str UTF8String]);
任何教程/链接/解决方案都会非常有用.
谢谢 !
ios ×12
iphone ×12
ipad ×6
objective-c ×4
xcode ×3
call ×1
facebook ×1
google-maps ×1
graph ×1
image ×1
json ×1
text ×1
uialertview ×1