在Swift中,发送短信失败但MFMessageComposeViewController委托显示已发送(In Swift, Failed to send SMS but MFMessageComposeViewController Delegate Show sent)

我正在使用MFMessageComposeViewController从我的应用程序发送短信。

MFMessageComposeViewControllerdidFinishWithResult委托方法显示消息已成功发送,但实际上由于余额不足,此SMS无法发送。 所以MFMessageComposeViewController没有显示正确的结果。

我怎么知道消息应用程序无法发送短信? 有没有办法获得失败的身份?


I am using MFMessageComposeViewController to send SMS from my app.

The didFinishWithResult delegate method of MFMessageComposeViewController shows that the message has been sent successfully but actually this SMS failed to send due to insufficient balance. So MFMessageComposeViewController does not show me the correct result.

How do I know that the Messages app failed to send an SMS? Is there any way to get the failed status?


原文:https://stackoverflow.com/questions/41993970
2023-12-09 10:12

满意答案

调用

t.run();

只需在当前线程(可能是FX Application线程)上调用run()方法。 要开始一个新的线程,你需要打电话

t.start();

假设threadclass (sic)是Thread一个子类。


Calling

t.run();

simply invokes the run() method on the current thread (which is probably the FX Application thread). To start a new thread, you need to call

t.start();

assuming threadclass (sic) is a subclass of Thread.

相关问答

更多

在循环中的imageview中显示图像(showing images in an imageview in a loop)

当你使用for循环时,它会尝试尽可能快地做你正在做的事情。 新的Showtime()。execute()不是阻塞调用,所以,你基本上会产生成千上万的线程加载图像,并且很快就会耗尽内存。 所以...假设Showtime是您的AsyncTask,您希望在该任务完成时触发图像显示的下一次迭代。 删除for()循环,只需使用Task作为显示图像的调度程序,然后等待,然后显示下一个。 此外,如果没有看到你的堆栈跟踪,就不可能知道你可能做错了什么,但我理所当然地认为你正在正确加载你的位图(你很可能不会这样)。...

ImageView最初没有显示图像(ImageView not showing image initially)

通过以下方式加载图像来解决此问题: //Loading image with placeholder and error image imageLoader.get(Const.URL_IMAGE, ImageLoader.getImageListener( imageView, R.drawable.ico_loading, R.drawable.ico_error)); Fixed the issue by loading the image in below way...

Imageview没有显示所有图像(Imageview not showing all image)

你像这样初始化imageView iv = new ImageView(ctx); 你应该像这样iv = (ImageView) findViewById(R.id.mImageView); Finally i got my problem solved. Issue was not in DCIM folder, issue was in size. The pictures taken from cell phone camera is very high and gallery was no...

使用线程在imageview中显示图像(showing image in imageview using thread)

您应该检查图像是否已下载,如果已下载,则可以使用ui线程更新UI mainActivity.this.runOnUiThread(new Runnable() { public void run() { ImageView imgView = (ImageView) findViewById(R.id.imageView1); imgView.setImageBitmap(BitmapFactory.decodeFile(getFilesDir() + "/"...

ImageView没有显示图像Titanium(ImageView not showing image Titanium)

您没有为ImageView指定高度。 var image = Ti.UI.createImageView({ image: '/images/name.png', width:200, height: Ti.UI.SIZE }); 如果你想让它成为动态的(如果你还不知道高度)或者给它一个固定的高度,可以使它成为Ti.UI.SIZE 。 You did not specify a height for the ImageView. var image = Ti.UI.cre...

while循环只显示1个结果(While loop only showing 1 result)

把你想要的回声放入一个在foreach之外声明的单个变量,并将每个div连接起来(每个循环对应一个foreach)。 然后在循环后回显它。 $boxitems = $_POST['box']; $insertedItems = array(); $duplicateItems = array(); foreach ($boxitems as $boxes) { $escapedBoxes = mysqli_real_escape_string($conn, $boxes); ...

循环中的模式始终只显示第一个图像(Modals in loop display always only the first image)

这与bootstrap无关,你正在用错误的剃刀语法分配唯一的id。 通常在剃刀中,当你用字符串编写c#代码时,该代码被视为字符串。 一个简单的解决方案是将c#代码封装在@(<your-c#-code>) 。 所以,你需要像这样分配唯一的ID: ... data-target="#Modal@(itm.PostImageGalleryId)" ... 和 ... id="Modal@(itm.PostImageGalleryId)"... This has nothing to do with ...

ImageView只显示循环中的最后一个图像(ImageView only showing last image in loop)

调用 t.run(); 只需在当前线程(可能是FX Application线程)上调用run()方法。 要开始一个新的线程,你需要打电话 t.start(); 假设threadclass (sic)是Thread一个子类。 Calling t.run(); simply invokes the run() method on the current thread (which is probably the FX Application thread). To start a new thr...

捕获后在ImageView中显示图像(android java)(Showing image in ImageView after capturing (android java))

我想你需要break; 在case CHOOSE_PHOTO_REQUEST:之前case CHOOSE_PHOTO_REQUEST: 。 这是一个可选项,但不幸的是,确定输出文件名完全取决于相机应用程序在设备上安装或用户选择的内容,即使它在MediaStore.EXTRA_OUTPUT指定。 因此除了data.getData()之外,您还应该看到data.getParcelableExtra(Intent.EXTRA_STREAM)和data.getData() 。 I guess you ne...

JavaFX:ImageView只显示一次Image(JavaFX: ImageView shows Image only once)

上面返回的ImageView存储在一个名为icon的字段中。字段用于以下代码中...... ImageView是Node的类型。 一个节点一次只能有一个父节点! 所以不要存储/缓存ImageView(-Node)。 创建新的ImageView节点。 编辑: 正如James_D的评论所指出的那样: ...你可以为每个ImageView使用相同的Image (-Object)... the ImageView returned above is stored into a field called i...

相关文章

更多

千锋首发Swift视频教程

千锋Swift视频教程-7.Swift结构体.mp4 千锋Swift视频教程-13.代理反向传值.mp ...

Swift入门视频教程-尚学堂视频教程

最新Swift语言语法介绍,包括Swift流程控制语句、Swift各种构造函数、closure、泛型、 ...

Nutch Job failed异常

truncate(分段方式)的页面,nutch的默认设置是不处理这种方式的,需要修改conf/nutc ...

解决Eclipse无法打开“Failed to load the JNI shared library”

今天在刚买的笔记本上打开eclipse出现Failed to load the JNI shared ...

Hive 终端产生的问题 (Failed to start database 'metastore_db', see the next exception for details.)

今天使用Hive的时候遇到一个这样的bug,上网查下原来是个小问题,在此记录下。 FAILED: Er ...

solr bin/snapinstaller 报 failed to connect to Solr server

昨天在用 solrj 在 solr 的子机上做索引,报错: The@DeprecatedSo ...

Failed to read auto-increment value from storage engine错误的解决方法

在进行数据的插入时,系统提示Failed to read auto-increment value f ...

Hadoop中 "Exceeded MAX_FAILED_UNIQUE_FETCHES”的错误

Hadoop中 &quot;Exceeded MAX_FAILED_UNIQUE_FETCHES”的错 ...

notepad++下载Subversion插件,显示intalltion of subversion failed

notepad++安卓subversion的插件不成功,是因为我们下载TortoiseSVN客户端的版 ...

android Failed to install .apk on device 'emulator-5554': timeout的解决方案

eclipse输出Failed to install HelloWorld.apk on device ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本