Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

Objective-C Programming

175

Solutions

202

Contributors

Objective-C is an object-oriented programming language that is a strict superset of C (any valid C code is equally valid Objective-C code), and it inherits its object-oriented capabilities from Smalltalk. All procedural syntax is identical to that of C, and all object-oriented syntax is an implementation of Smalltalk messaging. It is the main programming language used by Apple for OS-X and iOS and their respective APIs/ Objective-C inherits the syntax, primitive types, and flow control statements of C and adds syntax for defining classes and methods.

Share tech news, updates, or what's on your mind.

Sign up to Post

I have done a little Obj-C development years ago and do recall that the iPhone was great at protecting my app's data from the prying eyes of other apps running on my iPhone.

Is this completely safe? Or are there risks of having secret data belonging to one app being read by another?

And what about the database?

I think the database was called SqlLite? Is this still true?

Does the iPhone completely protect my app's data stored in the DB?

Thanks
0
[Webinar] Lessons on Recovering from Petya
LVL 10
[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

How to write test case for c program
0
Hi Experts,

I am very new into iOS programming and I need your help.

I have a simple code in XCode that uses GET to send data to URL and I want to change this to a POST.

When I test the call, both methods work okay, but running from XCode on simulator, GET works okay but POST returns empty value.

AFHTTPRequestOperationManager returns success.

Here is the code for both:

- (IBAction)cmdTestGET:(id)sender {

    AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] init];
    manager.requestSerializer = [AFJSONRequestSerializer serializer];
    manager.responseSerializer = [AFJSONResponseSerializer serializer];
   
    [manager GET:@"http://mytestwebsite/index_test.php"
      parameters: @{@"method":  @"Test_GET",
                    @"data":    @"Hello GET!"}
         success:^(AFHTTPRequestOperation *operation, id responseObject) {
             NSLog(@"JSON: %@", [responseObject description]);
         }
         failure:^(AFHTTPRequestOperation *operation, NSError *error) {
             NSLog(@"Error: %@", [error description]);
         }];
}

- (IBAction)cmdTestPost:(id)sender {
   
    AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] init];
    manager.requestSerializer = [AFJSONRequestSerializer serializer];
    manager.responseSerializer = [AFJSONResponseSerializer serializer];
   
    [manager POST:@"http://mytestwebsite/index_test.php"
                parameters: …
0
I am a rookie with programming but wanted to delve into programming for Androids.  What language should i use?  or what development program.?  also, does this language translate to coding pretty well if i wanted to create the same app for ios.
any commentary would be greatly appreciated
0
I need to open my OS X application when any powerpoint presentation opens.
I got VBA call back when powerpoint open (Auto_Open()). But I need a call back for each presentation open.

 In windows we can open  each presentation in separate powerpoint app (difference instance).
In Mac , Powerpoint app will open once and all presentation will open under same powerpoint application .

I need a call back when each presentation file open and I need to do run code snippets in my cocoa application.
0
{
  "EmployeeApp": [
    {
      "id": "1",
      "name": "Mr.ABC",
      "email": "ABC@XYZ.COM",
      "address": "xxx",
      "hr_review": {
        "1": {
          "hr_name": "Mr. f r",
          "hr_id": "13",
          "hr_comment": "he is one of the nice employee for company",
        },
        "2": {
          "hr_name": "Mr. b c",
          "hr_id": "14",
          "hr_comment": "Takes pride in work and strives to improve work performance",
        }
      }
    },
    {
      "id": "2",
      "name": "Mr.PQR",
      "email": "PQR@XYZ.COM",
      "address": "xxx",
    "hr_review": {
        "1": {
          "hr_name": "Mr. f r",
          "hr_id": "13",
          "hr_comment": "Forms and required paperwork are completed on time with minimal errors.",
        },
        "2": {
          "hr_name": "Mr. b c",
          "hr_id": "14",
          "hr_comment": "Maintains good working relationships with coworkers",
        }
      }
    }
  ]
}

Open in new window

0
I created a OSX application which contains powerpoint slides and can add these slides to any existing powerpoint presentation. I am using applescript and vba script to add slides from my OSX application to powerpoint. In Powerpoint 2016 mac version it is asking for "Grand file Access" permission popup always when I am adding slides.

Is there any way to remove this popup programatically.
Screen-Shot-2016-09-30-at-11.51.00-A.png
Screen-Shot-2016-09-30-at-11.51.14-A.png
And some times it is not pointing to the correct file location, and at that time the "Grant Access" button is not enabled.

Please help me. Thanks in Advance.
0
I need to observe powerpoint actions in my OSX app.
Scenario: I need to perform some actions in my OSX application when user clicks on save button in PowerPoint. Is there any ways to to this. I have achieved this functionality in Windows application by VBA Macro Events, but in PowerPoint Mac version the VBA Macro Events are not supported.
Thanks in advance
Please help me
0
When working with reverse geocoding some address could be ambiguous for given location and the returned array of placemarks can contain multiple values (address gets multiple hits). This happens very rarely. Usually practice is to take first or last object from given array. So, I want to know why is this common practice. I've looked in Apple documentation and they also took object at index 0. Does the first object contains the most accurate address if the array of placemarks contains more than one object for given location (lat, long)? Thanks for your answers.
0
Hi,
Does 2nd line below scan through all Worksheet within Excel file? If not, how to adjust it to scan through all Worksheets, except one specific sheet with a given name?
                    Excel.Worksheet Worksheet0;
                        ...
                        foreach (Excel.Worksheet sheet in Book0.WorkbookPart.Workbook.Descendants<Sheet>().Where(s => s.Name == Worksheet0))

Open in new window

0
Free Tool: ZipGrep
LVL 10
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Hi,
How to correct this
Error	2	'DocumentFormat.OpenXml.Packaging.SpreadsheetDocument' does not contain a definition for 'WorksheetParts' and no extension method 'WorksheetParts' accepting a first argument of type 'DocumentFormat.OpenXml.Packaging.SpreadsheetDocument' could be found (are you missing a using directive or an assembly reference?)

Open in new window


due to 2nd line below?

                    SpreadsheetDocument Book0 = SpreadsheetDocument.Open(openFileDialog1.FileName, false);
                    WorksheetPart worksheetPart = Book0.WorksheetParts.First();

Open in new window

0
Hi,
How to correct
Error	2	The type or namespace name 'Packaging' does not exist in the namespace 'System.IO' (are you missing an assembly reference?)

Open in new window


due to this line?

using System.IO.Packaging;

Open in new window

0
Hi,

It does take nearly 30 minutes to finish scanning these two sheets
https://app.box.com/s/zkm75d29hef82zct7bkw784iro8kmn64

using such codes
                    foreach (Excel.Worksheet sheet in Book0.Worksheets)
                    {
                        Excel.Range usedRange = sheet.UsedRange;

                        RowID++; Worksheet0.Cells[RowID, 1] = "^^^^" + sheet.Name + "^^^^"; RowID++;

                        foreach (Excel.Range row in usedRange.Rows)
                        {
                            RowID++;
                            for (int i = 0; i < row.Columns.Count; i++)
                                /*if (!string.IsNullOrEmpty(rowData[i]))
                                    j = 0;
                                else
                                    j++;*/

                                if (!string.IsNullOrEmpty(Convert.ToString(row.Cells[1, i + 1].Value2)))
                                {
                                    Worksheet0.Cells[RowID, i + 1] = row.Cells[1, i + 1].Value2;
                                    Worksheet0.Cells[RowID, i + 1].Interior.Pattern = row.Cells[1, i + 1].Interior.Pattern;
                                    ...

Open in new window

Why? Any other way to efficiently/quickly read the attached two Excel Worksheets?
0
Hi,
I get Error and STacktrace below

Exception from HRESULT: 0x800A03EC    at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
   at Microsoft.Office.Interop.Excel.Range.set__Default(Object RowIndex, Object ColumnIndex, Object value)
   at WindowsFormsApplication2.Form1.menuItem5_Click(Object sender, EventArgs e) in c:\dp13\General Application\WindowsFormsApplication5\WindowsFormsApplication2\Form1.cs:line 120

Open in new window

due to last line below
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Office.Interop;
using Microsoft.Office.Interop.Excel;
using System.IO.Compression;
using System.Diagnostics;
using System.Text; // This was needed to make ASCIIEncoding function
using Excel = Microsoft.Office.Interop.Excel;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        ...
        private void menuItem5_Click(object sender, System.EventArgs e)
        {
            string File1;
            File1 = "C:/dp2/List0.txt";
            const string fileName = @"c:/dp2/List0.dat";

            int RowID = 0, ColID = 0;
            Stopwatch stopwatch = new Stopwatch();
     

Open in new window

0
Hello Experts,

I have built a Windows desktop application that reads through a bunch of files and folders and analyzes them, and creates image previews while it loops through them.

Problem is that sometimes, when the file/folder structure is too large, it is taking nearly 100% of the system processor and RAM. I was able to successfully limit the RAM to take maximum 20% of the system's total, but I cannot manage to limit the CPU allowed resources.

Can you please share a piece of code  with me that will do the trick?
0
Hi,
To the codes like
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public void AddMenu()
        {
            MainMenu mnuFileMenu = new MainMenu();
            this.Menu = mnuFileMenu;
            System.Windows.Forms.MenuItem myMenuItemFile = new System.Windows.Forms.MenuItem("&File");
            System.Windows.Forms.MenuItem myMenuItemNew = new System.Windows.Forms.MenuItem("&New");
            mnuFileMenu.MenuItems.Add(myMenuItemFile);
            mnuFileMenu.MenuItems.Add(myMenuItemNew);
        }
        private void Form1_Load(object sender, System.EventArgs e)
        {
            AddMenu();
        }
    }
}

Open in new window

why can't the menu be shown to the form, by this project below?
https://app.box.com/s/oxsbqcr0kd72e4y3ww8ugogigoroibx0
0
Hi, I'm looking for a video tutorial series for Cocoa and Swift 2. I've searched high and low, but none that are current with Xcode 7.x and Swift 2. I've found a couple that are great, but most are Xcode 6 and Objective-C or iOS with Swift 1, but my question is specific - Xcode 7.x and Swift 2.

Does anyone have a link to a good tutorial series that meets those requirements?

Yes...I know that iOS is very similar to Cocoa, but I'd really like to find a tutorial set for Cocoa and not iOS.

Thanks,
Fulano
0
Hi,
Any advice to these
namespace ClassLibrary1
{
    public class Class1
    {
        bool allowappend = true;
        string File1="c:/dp2/oup.txt";
        string s = "9quali52ty3";
        byte[] ASCIIValues = Encoding.ASCII.GetBytes(s);
        foreach(byte b in ASCIIValues) {
                using (StreamWriter sw = new StreamWriter(@File1, allowappend, Encoding.Unicode))
                {
                    sw.WriteLine(b);
                    sw.WriteLine("");
                }
}
}
}

Open in new window


due to these
Error	1	Invalid token 'foreach' in class, struct, or interface member declaration	C:\dp11\ClassLibrary1\ClassLibrary1\Class1.cs	38	9	ClassLibrary1
Error	2	; expected	C:\dp11\ClassLibrary1\ClassLibrary1\Class1.cs	38	24	ClassLibrary1
Error	3	Invalid token ')' in class, struct, or interface member declaration	C:\dp11\ClassLibrary1\ClassLibrary1\Class1.cs	38	38	ClassLibrary1
Error	4	; expected	C:\dp11\ClassLibrary1\ClassLibrary1\Class1.cs	39	97	ClassLibrary1
Error	5	Invalid token '(' in class, struct, or interface member declaration	C:\dp11\ClassLibrary1\ClassLibrary1\Class1.cs	41	33	ClassLibrary1
Error	6	Invalid token ')' in class, struct, or interface member declaration	C:\dp11\ClassLibrary1\ClassLibrary1\Class1.cs	41	35	ClassLibrary1
Error	7	Invalid token '(' in class, struct, or interface member declaration	C:\dp11\ClassLibrary1\ClassLibrary1\Class1.cs	42	33	ClassLibrary1
Error	8	Type or namespace definition, or end-of-file expected	

Open in new window

0
hello
  i would like to know how to determine the location of an object pointed at by the camera on an ios and android,
My thinking is the location of the user/camera is determined by using the location services on the mobile device, utilize the compass and camera in the phone to determine the distance to object(building) in the center of the camera view?
utililize the distance and compass/angles to determine the lat/lon of the pointed at building. Reverse geo-code the coordinate to get the actual address.
Is this feasible? are there any API's provided by Android/IOS that would facilitate this?
0
Free Tool: SSL Checker
LVL 10
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi,
For Chinese word, I think there're many tens of thousands for use. Is there any automatic way to list out all Chinese word, from anything, like a Chinese dictionary?

But I can only select less than 2 thousand distinct Chinese words from these

http://www.zhongwen.com/

http://www.mdbg.net/chindict/chindict.php?page=cedict

Any other advice?
0
Hi,
For Chinese word, I think there're many tens of thousands for use. Is there any automatic way to list out all Chinese word, from anything, like a Chinese dictionary?
0
Hi,
Using these
            string text = File.ReadAllText( @File0 );
            var matches = Regex.Matches( text, @"(?<line>.*?)((?<eol>\r\n)|\r|\n)|(?<line>.+?)\z" ).Cast<Match>();

            foreach( var m in matches )
            {
                if( m.Groups["eol"].Success )
                {
                    using (StreamWriter sw = new StreamWriter(@File1, allowappend, Encoding.Unicode))
                    {
                        sw.WriteLine("GOOD: {m.Groups[line]}");
                        sw.WriteLine("");
                    }
                }
                else
                {
                    using (StreamWriter sw = new StreamWriter(@File1, allowappend, Encoding.Unicode))
                    {
                        sw.WriteLine("BAD:  {m.Groups[line]}");
                        sw.WriteLine("");
                    }
                }
            }

Open in new window

I cannot show which line is having the problem. What to adjust, in above, as I want to show the relevant line, which is not having either CR or LF, at the end of it, for every line within the given text file?
0
I am working with iPad developers on a project.

There are several pages that the iPad simply pulls in a url from my web service like an iframe.  I believe that is "includes" in iPad????

In any case... we are getting unexpected results...

Is there an online tool that I can test how those html pages will render in an iPad App?

Since these iPad developers are offshore... and 12 hours time difference
Any "try this" is literally a 2 day turn around.
0
I have next expressions:
1)      DataValue += (1<<i);
2)      if( ((DataValue>>i)&0x1) == 0x1 )
         {
            ; //Do something
         }
I need help to understand step by step what happens in the expressions above.
Could you write them in expanded format, simple line by line, eventually with some explanations?
0
In an IOS Swift application I have a function that is returning a date as a string like ("2016-04-18"). I need help with Swift code for a function that will take this string or any other string in this format (for any other date) and convert it into NSDate and return me that date as  a string in the following format "18 April 2016".
So if I give this function any other date in the format "2016-03-03" then I will get back "3 March 2016".
Thank you for your help.
0

Objective-C Programming

175

Solutions

202

Contributors

Objective-C is an object-oriented programming language that is a strict superset of C (any valid C code is equally valid Objective-C code), and it inherits its object-oriented capabilities from Smalltalk. All procedural syntax is identical to that of C, and all object-oriented syntax is an implementation of Smalltalk messaging. It is the main programming language used by Apple for OS-X and iOS and their respective APIs/ Objective-C inherits the syntax, primitive types, and flow control statements of C and adds syntax for defining classes and methods.

Top Experts In
Objective-C Programming
<
Monthly
>