iOSios 对话框框报异常,求解答。

&>&&>& > 正文
盗梦英雄IOS8.2系统导致对话框异常公告
  亲爱的玩家您好:
  目前由于IOS 8.2系统兼容性问题,导致游戏内部分对话框没法正常显示内容,
  盗梦技术组正在进行反复检查优化该问题中,给您带来的不便敬请谅解,
  该问题不会导致游戏出现其他问题,可继续正常体验,祝您游戏愉快。
盗梦英雄异常相关文章推荐:
点击返回琵琶网>>>
点击进入>>>
(已有0条评论)
你还可以输入200字
类型:动作
游戏采用了即时战斗模式,游戏集东西方英雄养成、策略竞技于一身。首创的盗梦穿越概念,引领玩家进入盗梦空间感受百万东西方英雄大乱斗。再配合顶尖Unity 3D引擎搭建,大片式极致高清画面,双倍提升酷爽...
热门推荐RECOMMEND
热门资讯NEWEWT
热门专区NEWEWT【已解决】关于iOS/iPhone中的文件选择对话框,用于用户去选择图片等文件
的过程中,需要支持用户选择图片,所以需要找到iPhone/iOS中,如何跳出相应的文件选择对话框,然后支持用户选择图片文件。
【解决过程】
1.结果找了一下,看到:
中说,iOS为了不让用户关心这些,故意隐藏了文件系统。
2. 后来从这里:
看到了相关的解释:
iPhone的程序只能访问对应程序文件夹里的资源,也即所谓“沙盒”的限制。
如果要访问系统图片库中的文件需要使用UIImagePickerController。
你要的选择效果需要自己来写,具体的文件操作请参考一下NSFileManager吧。
所以,就去找UIImagePickerController,然后就去去学习官网的解释:
3.在写代码过程中,还遇到一个找不到类的方法的问题,后来参考别人代码才搞懂,详细折腾过程参见:
4. 参考去写代码,想要显示选择图片的对话框,写出了代码:
self.imgPickerController = [[UIImagePickerController alloc] init];
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum])
NSArray *availableMediaTypeArr = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeSavedPhotosAlbum];
self.imgPickerController.mediaTypes = availableMediaTypeA
[self presentViewController:self.imgPickerController animated:YES completion:NULL];
结果运行时候出错:
13:41:00.077 BirdWatching[687:11603] *** Assertion failure in -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:], /SourceCache/UIKit_Sim/UIKit-1914.84/UIWindowController.m:188
13:45:42.968 BirdWatching[687:11603] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempting to begin a modal transition from &UINavigationController: 0x6ddd150& to &UIImagePickerController: 0x6df0b70& while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed'
*** First throw call stack:
(0x14b4cd6 0x145aa48 0xb1e2cb 0x46d648 0xx2559bc 0xea1e 0x24dfec 0x274f1d 0x25f1cb 0x275df1 0x275ea9 0x46f508 0x22c401 0x22d08b 0x46ed6c 0xx2559bc 0x2559fc 0x5bdf4a 0x5b24d0 0x14b3e99 0x18a14e 0x3c8a0e 0x14b3e99 0x18a14e 0x18a0e6 0x230ade 0x230fa7 0xx1af3c0 0x1af5e6 0x195dc4 0xx16c9ef5 0xx13eaff2 0x13e98da 0x13e8d84 0x13e8c9b 0x16c87d8 0x16c888a 0xx273d 0x26a5 0x1)
terminate called throwing an exception(lldb)
看来是显示界面的切换transition过程中,出错了。
5.后来想了想,其实此处需要实现的是,对于图片,点击对应的图片的话,然后再弹出对应的选择图片的对话框。
所以,首先是要响应点击对应的点击Image View的事件才可以。
不过,官网中的解释,只说到需要把userInteractionEnabled设置为True,对此,我已经在storyboard中选中了 User Interaction Enabled:
但是接下来,到底如何获得点击图片的事件,却还是不懂。
6.然后去搜了搜,然后找到:
大概看懂了,是通过获得鼠标点击的手势来实现的。
7.但是问题来了,我之前通过之前拖放一个UIImageView到UITableViewCell中,但是由于image和highlightedImage没有设置,是空的,所以不显示。
而之所以没有设置图片的原因是,对于iOS模拟器来说,不知道从哪里找到图片。
8。现在的想法是,把某个图片当做默认的BirdImage显示的图片,其他的,提供选择自定义。
所以,希望把某个图片集成到iOS程序内部中,这样可以直接引用了。
关于如何集成图片到iOS项目中,并显示,折腾过程参考:
9.经过折腾,终于实现了添加图片到iOS模拟器中,详情参考:
这样,后续代码去调用窗口,才能有图片供显示,供用户选择。
10.下面接着去添加代码支持,点击图片,然后可以跳出(图片选择)对话框,选择图片。
然后先去学习了:,然后写了代码,结果运行出错,解决过程参考:
最后的可以运行的代码是:
- (void)viewDidLoad
self.imgPickerController = [[UIImagePickerController alloc] init];
UITapGestureRecognizer *imgTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleImageTap:)];
imgTap.numberOfTapsRequired = 1;
imgTap.numberOfTouchesRequired = 1;
[self.birdImageView addGestureRecognizer:imgTap];
//handle the tap to image
-(void)handleImageTap:(UITapGestureRecognizer *)sender{
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum])
NSArray *availableMediaTypeArr = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeSavedPhotosAlbum];
self.imgPickerController.mediaTypes = availableMediaTypeA
[self presentViewController:self.imgPickerController animated:YES completion:NULL];
11.但是,此时,也只是可以运行到handleImageTap函数里面而已,具体如何打开图片选择框,还是没有实现。
所以,继续去学习如何切换界面,打开图片选择框。
结果发现,上述代码,其实是已经可以正常工作了,可以跳转到对应的Album界面,可以浏览对应图片了:
只是暂时由于没有实现函数,所以选择了图片后,又调回原有界面而已。
12.现在去添加代码实现将选中的图片,保存为对应的Bird的图片。
关于如何获得选择的图片,参考官网的:
中的解释,是需要实现对应的delegate的:.
所以就去添加代码实现对应的delegate。
然后参考:
添加了.h中的delegate声明后,.m中去实现代码:
#pragma UIImagePickerControllerDelegate
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
//set selectd img to bird img
//get selected image
UIImage *selectedImg = [info valueForKey:UIImagePickerControllerOriginalImage];
self.birdImageView.image = selectedI
但是却是,选中一个图片后,代码却没有执行到此函数。
然后又是才想起来,忘了设置delegate了。。。。
13.然后设置delegate时又出现错误,最后也解决了,折腾过程参考:
14.可以正常设置delegate后,就可以正常执行handleImageTap,然后跳转到对应的选择图片的界面,最后选择图片后,可以执行
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
去设置所选图片给对应的变量了,但是还存在一个问题,所选图片后,Album界面没有消失,需要手动点击Cancel,才能回到原先界面:
15.现在继续去折腾,希望点击选择一个图片后,对应的页面也跳转回来到原先界面。
即,点击选择一个图片后,当前Album界面消失,界面回到原先的UITableView界面。
然后搜到:
然后看到有个函数dismissModalViewControllerAnimated,就去搜了下,找到:
dismissModalViewControllerAnimated:
Dismisses the view controller that was presented by the receiver. (Deprecated. Use
所以,再去看:
dismissViewControllerAnimated:completion:
Dismisses the view controller that was presented by the receiver.
- (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion
Parameters
Pass YES to animate the transition.
completion
A block called after the view controller has been dismissed.
Discussion
The presenting view controller is responsible for dismissing the view controller it presented. If you call this method on the presented view controller itself, it automatically forwards the message to the presenting view controller.
If you present several view controllers in succession, thus building a stack of presented view controllers, calling this method on a view controller lower in the stack dismisses its immediate child view controller and all view controllers above that child on the stack. When this happens, only the top-most view is dismissed in any intermediate view controllers are simply removed from the stack. The top-most view is dismissed using its modal transition style, which may differ from the styles used by other view controllers lower in the stack.
If you want to retain a reference to the receiver’s presented view controller, get the value in the
property before calling this method.
The completion handler is called after the
method is called on the presented view controller.
Availability
Available in iOS 5.0 and later.
Declared In
UIViewController.h
所以,意思很明显,就是让当前显示的画面消失。
然后就去添加dismissModalViewControllerAnimated的代码,变成:
#pragma UIImagePickerControllerDelegate
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
//set selectd img to bird img
//get selected image
UIImage *selectedImg = [info valueForKey:UIImagePickerControllerOriginalImage];
self.birdImageView.image = selectedI
[self dismissModalViewControllerAnimated:YES];
然后运行结果就是达到效果了,点击一个图片后,可以自动消失掉Album的界面,回到原先界面:
至此,算是终于搞定了用户自定义选择图片的问题。
想要实现用户自定义选择图片的问题。
此处的总的逻辑是:
1.对于已经显示的某个图片,点击该图片
2. 通过UITapGestureRecognizer实现了能检测到Tap单击的动作,然后调用对应的自定义的函数
3. 在函数中,使用UIImagePickerController去打开iOS(模拟器中的)相册Album
4. 然后用户可以选择自己需要的某张图片,单击图片会触发对应的事件
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
5. 然后在该函数中,可以获得所选图片,进行你所需要的相应的处理,然后调用dismissModalViewControllerAnimated将显示窗口切换回原来的界面,即可。
2015年四月
1516171819
20212223242526
免费的格式化Javascript源码的网站
查询Unicode字符,且还带Oct,Decimal,Hex,HTML Entity
HTML和Javascript都支持,很好用。当前位置: >
> 初学android,第二个程序就是检查不出错!求解、异常弹出对话框显示stoped unexpected
初学android,第二个程序就是检查不出错!求解、异常弹出对话框显示stoped unexpected
lvyabing_1980 & at
初学android,第二个程序就是检查不出错!求解、、;错误弹出对话框显示stoped unexpected,Android Launch![ 16:42:29 - Activity_03] adb is running normally.[ 16:42:29 - Activity_03] Performing mars.Activity03.Activity03 activity launch[ 16:42:29 - Activity_03] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'android1.6'[ 16:42:34 - Activity_03] Application already deployed. No need to reinstall.[ 16:42:34 - Activity_03] Starting activity mars.Activity03.Activity03 on device emulator-5554[ 16:42:38 - Activity_03] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=mars.Activity03/.Activity03 }error:E/AndroidRuntime(805): Uncaught handler: thread main exiting due to uncaught exception(这个哪里会有异常? )03-13 08:50:03.854: E/AndroidRuntime(805): java.lang.RuntimeException: Unable to start activity ComponentInfo{mars.Activity03/mars.Activity03.ResultActivity}: java.lang.NumberFormatException: unable to parse 'null' as integer(我在两个框里输入的都是整数,怎么不能转了 )Activity03.java内容如下:  Java code   package mars.Activity03; import android.app.Aimport android.content.Iimport android.os.B import android.view.Vimport android.view.View.OnClickL import android.widget.*;
public class Activity03 extends Activity {
private EditText factorOne,factorT
private TextV
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//根据控件的ID来取得代表控件的对象
factorOne=(EditText)findViewById(R.id.factorOne);
factorTwo=(EditText)findViewById(R.id.factorTwo);
symbol=(TextView)findViewById(R.id.symbol);
calculate=(Button)findViewById(R.id.calculate);
// symbol.setText(&乘以&);
//calculate.setText(&计算&);
symbol.setText(R.string.symbol);
calculate.setText(R.string.calculate);
calculate.setOnClickListener(new CalculateListener());
class CalculateListener implements OnClickListener{
public void onClick(View arg0) {
// TODO Auto-generated method stub
//取得两个
String factorOneStr=factorOne.getText().toString();
String factorTwoStr=factorTwo.getText().toString();
Intent intent=new Intent();
intent.putExtra(&one&, factorOneStr);
intent.putExtra(&two&, factorTwoStr);
intent.setClass(Activity03.this, ResultActivity.class);
Activity03.this.startActivity(intent);
System.out.println(&onClick--error&);
对应main.xml如下:  XML code   & xml version=&1.0& encoding=&utf-8& & &LinearLayout xmlns:android=&;
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:orientation=&vertical& & &EditText
android:id=&@+id/factorOne&
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
android:id=&@+id/symbol&
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
android:text=&@string/hello& /& &EditText
android:id=&@+id/factorTwo&
android:layout_width=&fill_parent&
android:layout_height=&wrap_content& /& &Button
android:id=&@+id/calculate&
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
/& &/LinearLayout&
本问题标题:
本问题地址:
温馨提示:本问题已经关闭,不能解答。
暂无合适的专家
&&&&&&&&&&&&&&&
希赛网 版权所有 & &&&&湘教QS2-164&&增值电信业务经营许可证湘B2-为什么很多第三方iOS应用都不用系统默认的对话框控件?
比如微博客户端的评分弹窗,做工非常粗糙-_-#:&br&&img data-rawheight=&960& data-rawwidth=&640& src=&/be8e08cebfd6ade383271be_b.jpg& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&/be8e08cebfd6ade383271be_r.jpg&&&br&某助手更新对话框,虽然比微博的弹窗好看多了但仍然不是系统对话框的样式(这是ios6设备哪来的扁平化……):&br&&img data-rawheight=&960& data-rawwidth=&640& src=&/50d8cea4de92604bb0cb_b.jpg& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&/50d8cea4de92604bb0cb_r.jpg&&&br&微信:&br&&img data-rawheight=&960& data-rawwidth=&640& src=&/3f0c787e97addf865f4639b3edf05459_b.jpg& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&/3f0c787e97addf865f4639b3edf05459_r.jpg&&
比如微博客户端的评分弹窗,做工非常粗糙-_-#:…
因为产品经理跟老板喜欢。

我要回帖

更多关于 ios 对话框 的文章

 

随机推荐