小编Siv*_* Km的帖子

JSOn对象没有在wcf webservice端正确反序列化

我正在研究iOS项目并通过wcf webservice将Json字符串发送到后端,它为许多用户成功工作,但对于一些用户后端获取不完整的json字符串.

生成Json字符串的代码

NSData *data = [NSJSONSerialization dataWithJSONObject:EmployeeDetails options:0 error:nil];
    NSString *JsonString = [[NSString alloc] initWithData:data
                                                 encoding:NSUTF8StringEncoding];
Run Code Online (Sandbox Code Playgroud)

并通过以下代码附加请求附加json字符串

[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:[jsonString dataUsingEncoding:NSUTF8StringEncoding]];
Run Code Online (Sandbox Code Playgroud)

EmployeeDetails是NSMutableDictionary,包含员工详细信息.

这是从BackEnd反序列化的成功Json字符串

{"FirstName":"Donald","LastCBPaymentType":6,"AcceptEmail":true,"CellPhone":"321-300-6874","Position":"3","CarrierNum":"4","EmpNum":"96874"}
Run Code Online (Sandbox Code Playgroud)

和不完整的Json字符串

{"FirstName":"roset","LastCBPaymentType":6,"AcceptEmail":true,"CellPhone":"321-300-6874","Position":"3","CarrierNum":"4","EmpNum":"98799
Run Code Online (Sandbox Code Playgroud)

某些用户在后端发生不完整的json字符串.

任何人都可以帮助解决这个问题?

c# wcf json web-services ios

16
推荐指数
1
解决办法
348
查看次数

如何使用applescript在powerpoint中更改组中所选形状的颜色?

当我将n个形状分组在一个组中,并从组中选择一个形状并更改颜色,但是该组中所有形状的颜色变化,如何克服这个插孔?,我需要从该组中更改该特定形状的颜色

下面代码改变所有形状的颜色

tell application "Microsoft PowerPoint"
    activate

    set theShapeRange to shape range of selection of active window
    set selected to child shape range of selection of active window


    set n to (count shapes of theShapeRange)
    repeat with i from 1 to n
        tell shape i of theShapeRange
            set fore color of fill format of it to {14, 235, 5}
            set back color of fill format of it to {14, 235, 5}
        end tell
    end repeat

end tell
Run Code Online (Sandbox Code Playgroud)

powerpoint applescript

8
推荐指数
1
解决办法
664
查看次数

在iOS 9(Xcode 7)中使用UICollectionViewLayoutAttributes时的EXC_ARITHMETIC

在Xcode 7,iOS 9中运行我的应用程序时出现EXC_ARITHMETIC错误.但它在下载版本中运行良好(Xcode 6.4,iOS 8.4)

请在下面找到代码

UICollectionViewFlowLayout *flowlayout = (UICollectionViewFlowLayout *)self.collectionViewLayout;
    NSUInteger count = _tripButtons.count;
    for (NSUInteger i = 0; i < count; ++i)
{
        UIView *tripButton = [_tripButtons pointerAtIndex:i];
        if (tripButton)
     {
            CGRect frame = tripButton.frame;
               // Getting error with below line
                UICollectionViewLayoutAttributes *layout = [flowlayout layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:i inSection:0]];
                frame.origin.x = layout.frame.origin.x;
                frame.origin.y = layout.frame.origin.y;
                tripButton.frame = frame;



        }
    }
Run Code Online (Sandbox Code Playgroud)

我对这个错误很困惑.这个错误是由于我的代码中的错误还是由于我的升级造成的.请指导我......

xcode ios ios9

8
推荐指数
0
解决办法
383
查看次数

获取 Powerpoint 加载项 Mac 的存储位置

我必须从我的 cocoa 应用程序将 powerpoint 插件添加到 Powerpoint Mac。我已经通过以下代码从我的 cocoa 应用程序添加了 .ppam 文件

 NSString *pluginPath = [[NSBundle mainBundle] pathForResource:@"Kahani2016" ofType:@"ppam"];
    [[NSWorkspace sharedWorkspace] openFile:pluginPath];
Run Code Online (Sandbox Code Playgroud)

它适用于大多数 powerpoint。我们可以从powerpoint中查看添加的powerpoint插件

但有些系统显示以下错误消息 在此输入图像描述

我正在尝试解决这个问题。我尝试通过使用 .ppam 文件添加数字签名来解决此问题。但无助于解决问题。我只是感到困惑,因为我试图在另一台具有相同 OSX 和 Powerpoint 版本的计算机上重现此问题,但它在另一台计算机上工作正常。我的配置 Powerpoint 15.29.1 Mac

因此,如果我获得 powerpoint-Addin 的位置,那么我可以尝试将我的加载项复制到该位置并解决问题。

macos cocoa powerpoint vba office-addins

5
推荐指数
0
解决办法
772
查看次数

如何设置 SKProductsRequest 超时秒?SKProductsRequest 的默认超时秒数是多少?

是否可以为 SKProductsRequest 设置超时?有人知道 SKProductsRequest 的默认超时吗?

timeout objective-c in-app-purchase ios

4
推荐指数
1
解决办法
693
查看次数

如何从 sourceTree 忽略 Bin 和调试文件

我在源树中有 Xamarin.iOS 项目 git 文件。问题是列出调试文件的 xamarin 未暂存文件。我试图忽略调试。文件使用 .gitignore 文件放置在 bin 和 obj 文件夹中。仍然列出调试文件。

这是我使用网站https://www.gitignore.io创建的 gitignore 文件内容

-------------------------
# Created by https://www.gitignore.io/api/macos,visualstudio,xamarinstudio

### macOS ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### XamarinStudio ###
bin/
obj/
*.userprefs …
Run Code Online (Sandbox Code Playgroud)

git macos xamarin atlassian-sourcetree

1
推荐指数
1
解决办法
2866
查看次数